#include <stdio.h>
int main()
{
double price;
int road=12;
if(road<=3)
{
price=13+1;
}
else
{
price=13+(road-3)*2.3+1;
}
price=price*2;
printf("小明每天打车的总费用为%f元",price);
return 0;
}
int main()
{
double price;
int road=12;
if(road<=3)
{
price=13+1;
}
else
{
price=13+(road-3)*2.3+1;
}
price=price*2;
printf("小明每天打车的总费用为%f元",price);
return 0;
}
这是神马错误 In function 'main':
error: stray '\357' in program
error: stray '\274' in program
error: stray '\237' in program
error: stray '\357' in program
error: stray '\274' in program
error: stray '\237' in program
error: stray '\357' in program
error: stray '\274' in program
error: stray '\237' in program
error: stray '\357' in program
error: stray '\274' in program
error: stray '\237' in program
首先对于本节的 weight = 82.5;说用double 不用float的,表示无所谓!不过占的内存就不一样了, 范围问题,float(4字节)涵盖在double(8字节)里面,请看最后一个图表!
%d : 以10进制打印一个整数。例如:Printf(“2 + 2 = %d\n”, 2 + 2);将打印出2 + 2 = 4.
%d 不是double的缩写,而是decimal的缩写!
%d : 以10进制打印一个整数。例如:Printf(“2 + 2 = %d\n”, 2 + 2);将打印出2 + 2 = 4.
%d 不是double的缩写,而是decimal的缩写!
2015-02-27
#include <stdio.h>
int main()
{
int sum = 0;
int i;
for(i=1; i<=10; i++)
{
printf("%d\n", i);
if(i==3){
goto END;
}
}
END:printf("结束for循环了....");
return 0;
}
int main()
{
int sum = 0;
int i;
for(i=1; i<=10; i++)
{
printf("%d\n", i);
if(i==3){
goto END;
}
}
END:printf("结束for循环了....");
return 0;
}
2015-02-26
#include <stdio.h>
int main()
{
int sum = 0;
int i;
for(i=1; i<=10; i++)
{
printf("%d\n", i);
if(i==3){
goto OUT;
}
}
OUT:printf("结束for循环了....");
return 0;
}
int main()
{
int sum = 0;
int i;
for(i=1; i<=10; i++)
{
printf("%d\n", i);
if(i==3){
goto OUT;
}
}
OUT:printf("结束for循环了....");
return 0;
}
2015-02-26