鱼C论坛

 找回密码
 立即注册
查看: 2176|回复: 3

求求大神帮看一下为什么编译不出来

[复制链接]
发表于 2022-4-3 21:54:24 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能^_^

您需要 登录 才可以下载或查看,没有账号?立即注册

x
这个代码为什么编译不出来

#include <stdio.h>
int main()
{
    printf("This is a C program about a “figure”.\n");
    printf("This is a \nC program.\n");
    printf("你看我穿的一身瓦萨奇,我怎么打。\n");
    printf("This \tis \ta \tC \t program.\n");
    printf("This is a C program.\n");
   
    int x1,y1,z1,a1;
    scanf("%d %d %d",&x1,&y1,&z1);
    a1=x1 * y1 * z1;
    printf("The product is %d\n",a1);
   
    int x2,y2,a2;
    scanf("%d %d",&x2,&y2);
    a2=x2/y2;
    printf("The division is %d\n",a2);
   
    int x3,y3,a3;
    scanf("%d %d",&x3,&y3);
    a3=x3%y3;
    printf("The remainder is %d\n",a3);
   
   
    int x4;
    x4=8+15*(6-2)-1;
    printf("%d\n",x4);
   
    int x5;
    x5=(5*7*(5+(7*5/(7))));
    printf("%d\n",x5);
   
    int x6;
    x6=5%5+5*5-5/5;
    printf("%d\n",x6);
   
    int x7,y7,b,c,d,e,f;
    scanf("%d %d",&x7,&y7);
    b=x7+y7;
    c=x7-y7;
    d=x7*y7;
    e=x7/y7;
    f=x7%y7;
    printf("%d %d %d %d %d",b,c,d,e,f);
   
    int u,a,t,v;
    scanf("%d %d %d",&u,&a,&t);
    v=u+a*t;
    printf("%d",v);
   
    int u2,a2,t2,s;
    scanf("%d %d %d",&u2,&a2,&t2);
    s=u2*t2+1/2*(a2*t2*t2);
    printf("%d",s);
   
    int max,all;
    scanf("%d %d",&max,&all);
    if(all>max)
    {
        printf("%d values the highest rainfall ever.",all);
    }
    else
    {
        printf("%d values the highest rainfall ever.",max);
    }
   
   
    int i=0;
    start;
    if(i<=10)
    {
        printf("%d\t%d\t%d\n",i,i*i,i*i*i);
        i=i+1;
        goto start;
    }
   
}
小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

发表于 2022-4-3 21:58:19 | 显示全部楼层
  1. #include <stdio.h>
  2. int main()
  3. {
  4.     printf("This is a C program about a “figure”.\n");
  5.     printf("This is a \nC program.\n");
  6.     printf("你看我穿的一身瓦萨奇,我怎么打。\n");
  7.     printf("This \tis \ta \tC \t program.\n");
  8.     printf("This is a C program.\n");

  9.     int x1,y1,z1,a1;
  10.     scanf("%d %d %d",&x1,&y1,&z1);
  11.     a1=x1 * y1 * z1;
  12.     printf("The product is %d\n",a1);

  13.     int x2,y2,a2;
  14.     scanf("%d %d",&x2,&y2);
  15.     a2=x2/y2;
  16.     printf("The division is %d\n",a2);

  17.     int x3,y3,a3;
  18.     scanf("%d %d",&x3,&y3);
  19.     a3=x3%y3;
  20.     printf("The remainder is %d\n",a3);


  21.     int x4;
  22.     x4=8+15*(6-2)-1;
  23.     printf("%d\n",x4);

  24.     int x5;
  25.     x5=(5*7*(5+(7*5/(7))));
  26.     printf("%d\n",x5);

  27.     int x6;
  28.     x6=5%5+5*5-5/5;
  29.     printf("%d\n",x6);

  30.     int x7,y7,b,c,d,e,f;
  31.     scanf("%d %d",&x7,&y7);
  32.     b=x7+y7;
  33.     c=x7-y7;
  34.     d=x7*y7;
  35.     e=x7/y7;
  36.     f=x7%y7;
  37.     printf("%d %d %d %d %d",b,c,d,e,f);

  38.     int u,a,t,v;
  39.     scanf("%d %d %d",&u,&a,&t);
  40.     v=u+a*t;
  41.     printf("%d",v);

  42.     int u2,t2,s;
  43.     scanf("%d %d %d",&u2,&a2,&t2);
  44.     s=u2*t2+1/2*(a2*t2*t2);
  45.     printf("%d",s);

  46.     int max,all;
  47.     scanf("%d %d",&max,&all);
  48.     if(all>max)
  49.     {
  50.         printf("%d values the highest rainfall ever.",all);
  51.     }
  52.     else
  53.     {
  54.         printf("%d values the highest rainfall ever.",max);
  55.     }


  56.     int i=0;
  57. start:
  58.     if(i<=10)
  59.     {
  60.         printf("%d\t%d\t%d\n",i,i*i,i*i*i);
  61.         i=i+1;
  62.         goto start;
  63.     }

  64. }
复制代码
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2022-4-3 22:09:50 | 显示全部楼层
本帖最后由 jackz007 于 2022-4-3 22:12 编辑

        第 52、70句有错误,错误原因已经在代码中标注。
  1. #include <stdio.h>
  2. int main()
  3. {
  4.     printf("This is a C program about a “figure”.\n");
  5.     printf("This is a \nC program.\n");
  6.     printf("你看我穿的一身瓦萨奇,我怎么打。\n");
  7.     printf("This \tis \ta \tC \t program.\n");
  8.     printf("This is a C program.\n");
  9.    
  10.     int x1,y1,z1,a1;
  11.     scanf("%d %d %d",&x1,&y1,&z1);
  12.     a1=x1 * y1 * z1;
  13.     printf("The product is %d\n",a1);
  14.    
  15.     int x2,y2,a2;
  16.     scanf("%d %d",&x2,&y2);
  17.     a2=x2/y2;
  18.     printf("The division is %d\n",a2);
  19.    
  20.     int x3,y3,a3;
  21.     scanf("%d %d",&x3,&y3);
  22.     a3=x3%y3;
  23.     printf("The remainder is %d\n",a3);
  24.    
  25.    
  26.     int x4;
  27.     x4=8+15*(6-2)-1;
  28.     printf("%d\n",x4);
  29.    
  30.     int x5;
  31.     x5=(5*7*(5+(7*5/(7))));
  32.     printf("%d\n",x5);
  33.    
  34.     int x6;
  35.     x6=5%5+5*5-5/5;
  36.     printf("%d\n",x6);
  37.    
  38.     int x7,y7,b,c,d,e,f;
  39.     scanf("%d %d",&x7,&y7);
  40.     b=x7+y7;
  41.     c=x7-y7;
  42.     d=x7*y7;
  43.     e=x7/y7;
  44.     f=x7%y7;
  45.     printf("%d %d %d %d %d",b,c,d,e,f);
  46.    
  47.     int u,a,t,v;
  48.     scanf("%d %d %d",&u,&a,&t);
  49.     v=u+a*t;
  50.     printf("%d",v);
  51.    
  52.     int u2,t2,s;            // 此处变量 a2 属于重复定义,必须去掉。
  53.     scanf("%d %d %d",&u2,&a2,&t2);
  54.     s=u2*t2+1/2*(a2*t2*t2);
  55.     printf("%d",s);
  56.    
  57.     int max,all;
  58.     scanf("%d %d",&max,&all);
  59.     if(all>max)
  60.     {
  61.         printf("%d values the highest rainfall ever.",all);
  62.     }
  63.     else
  64.     {
  65.         printf("%d values the highest rainfall ever.",max);
  66.     }
  67.    
  68.    
  69.     int i=0;
  70.     start:              // 此处的语句标号应该是冒号,不能是分号。
  71.     if(i<=10)
  72.     {
  73.         printf("%d\t%d\t%d\n",i,i*i,i*i*i);
  74.         i=i+1;
  75.         goto start;
  76.     }
  77.    
  78. }
复制代码
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

 楼主| 发表于 2022-4-3 22:32:36 | 显示全部楼层
改了之后codeblock也编不出来啊
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2025-7-4 14:57

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表