[ create a new paste ] login | about

Link: http://codepad.org/V1kiXDs5    [ raw code | output | fork | 1 comment ]

C++, pasted on Jul 14:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include<stdio.h>

int main(void)
{

double hight,weight,bmi;

puts("身長と体重を入力してください。");
printf("身長(㎝):"); scanf("%lf",&hight);
printf("体重(㎏):"); scanf("%lf",&weight);

bmi = weight / hight / hight * 10000;
bmi = weight / ( hight / 100 * hight / 100 );

printf("身長:%5.1lf(cm)\n",hight);
printf("体重:%5.1lf(kg)\n",weight);
printf("あなたのBMI値は%5.1lfです。\n", bmi);

return(0);

}


Output:
1
2
3
4
5
cc1plus: warnings being treated as errors
In function 'int main()':
Line 16: warning: ISO C++ does not support the '%lf' printf format
Line 17: warning: ISO C++ does not support the '%lf' printf format
Line 18: warning: ISO C++ does not support the '%lf' printf format


Create a new paste based on this one


Comments:
posted by tigirikobusi on Jul 14
hight?
reply