啊哈磊_编程从这里起步

标题: (萌新)急救啊,很简单的我不知道哪里出错了 [打印本页]

作者: MalaGirl_YoYo    时间: 2018-11-6 18:39
标题: (萌新)急救啊,很简单的我不知道哪里出错了
求助。。。


数字的家 作品4(待解决).c

193 Bytes, 下载次数: 22


作者: 卢永聪    时间: 2018-11-7 14:10
#include <stdio.h>
#include <stdlib.h>
int main()
{
        float a,b,c,d,e;
    a=1.2;
    b=2.3;
    c=3.4;
    d=4.5;
    e=a+b+c+d
    printf("%f",e);
        system("pause");
        return 0;
}
需要改几次,1是集合为int,2是e=a+b+C+D后面有分隔号;
正确为
#include <stdio.h>
#include <stdlib.h>
int main()
{
    int  a,b,c,d,e;
    a=1.2;
    b=2.3;
    c=3.4;
    d=4.5;
    e=a+b+c+d;
    printf("%d",e);
        system("pause");
        return 0;
}




作者: DNLINYJ    时间: 2018-11-9 22:35
在“e=a+b+c+d”这里末尾应该变成“e=a+b+c+d; "


作者: tc_Genie    时间: 2018-11-15 22:26
#include <stdio.h> #include <stdlib.h> int main() {         float a,b,c,d,e;     a=1.2;     b=2.3;     c=3.4;     d=4.5;     e=a+b+c+d;     printf("%f",e);         system("pause");         return 0; }
作者: tc_Genie    时间: 2018-11-15 22:27
#include <stdio.h>
#include <stdlib.h>
int main()
{
        float a,b,c,d,e;
    a=1.2;
    b=2.3;
    c=3.4;
    d=4.5;
    e=a+b+c+d;
    printf("%f",e);
        system("pause");
        return 0;
}:@:@:@:@:@:@:@:@:@:@:@:@:@:@:@
作者: 時光    时间: 2018-11-17 21:51
你这个就是运行不了,但我自己照着你的输一遍就可以,好像是有无效值
作者: 林li0n    时间: 2018-12-16 09:01
e=a+b+c+d这句结尾没打分号
作者: 轩兆谢    时间: 2019-2-3 09:19


作者: 元元二郎    时间: 2019-2-15 17:13
#include <stdio.h>
#include <stdlib.h>
int main()
{
         float a,b,c,d,e;
     a=1.2;
     b=2.3;
     c=3.4;
     d=4.5;
     e=a+b+c+d;
     printf("%f",e);
         system("pause");
         return 0;
}




欢迎光临 啊哈磊_编程从这里起步 (https://bbs.codeaha.com/) Powered by Discuz! X3.2