#include <cmath>
#include <stdlib.h>
#include <iostream>
using namespace std;
int main() {
float r;
scanf("%f",&r);
float n1 = printf("%.0f\n",trunc ( r*pow(1024,2)*pow(760*1024,-1) ));
printf ("%f", n1);
return 0;
}
#include <cmath>
#include <stdlib.h>
#include <iostream>
using namespace std;
int main() {
float r;
scanf("%f",&r);
float n1 = printf("%.0f\n",trunc ( r*pow(1024,2)*pow(760*1024,-1) ));
printf ("%f", n1);
return 0;
}
已进入 32
计算并输出43,不带小数位(要求
"%.0f\n")其中
n1(由于某种原因float)显示了显示的字符数 - 其中有 3 个(包括换行符)。他们把这三个人拿出来了。默认值为句点 ( ) 后的六位数字
"%f"。怎么了?