一个水分子的质量是3.0*10-23克,一夸脱水的质量是950克。写一个程序输入水的夸脱数n(0 <= n <= 1e10),然后输出水分子的总数。
输入
109.43
输出
输入
109.43
输出
3.465283E+027
C
#include <stdio.h>
int main(){
float a;
scanf("%f",&a);
a =(a * 950)/(3.0*1e-23);
printf("%.6E",a);
return 0;
}
C++
#include <iostream>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <cstdio>
#include <string>
#include <vector>
#include <ctime>
using namespace std;
const int MAX = 20;
const int Mod = 99999999;
#define inf 0x3f3f3f3f
#define lson l,mid,i<<1
#define rson mid+1,r,i<<1|1
typedef long long ll;
const double c = 3E-23;
int main()
{
// freopen("C:/Users/lqy/Desktop/in.txt","r",stdin);
double n;
cin>>n;
double res = n*950/c;
// char str[256];
// sprintf(str, "%lf", res);
// cout<<str;
printf("%E",res);
return 0;
}