这c语言程序设计那里错了

C语言程序,这个程序到底哪错了啊,运行不了_百度知道
C语言程序,这个程序到底哪错了啊,运行不了
圆球表面积,Va;n&quot.2f\%f&quot.2f&#92,Va); Va=PI*r*r*r*4/; Vb=Sa*h;#define PI 3:%:%;圆周长;n&;n&quot,L; printf(&圆柱体积,Sb):%,L);
Sa=PI*r*r;;圆面积,h=3.1415926void main(){圆球体积,Vb;,&r&3; printf(&; printf(&quot,Sb.2f&#92#include&n& printf(& L=2*PI*r.2f&#92:& Sb=4*PI*r*r;stdio.h& printf(&); printf(&),Sa),Vb),Sa.2f\n&圆的半径;; scanf(&quot:%:%
%,Sb;;n& scanf(&n& printf(& Va=PI*r*r*r*4/%lf& Vb=Sa*h;#define PI 3.2f&#92.2f\圆周长;,L);.00,Vb:%; printf(&quot.2f\ printf(& Sa=PI*r*r,Va):%,h=3.1415926void main(){ double r:%,Va,Sa);;3;圆柱体积,Sb);圆球体积,Sa;n&quot#include&; printf(& L=2*PI*r;n&圆的半径; Sb=4*PI*r*r;stdio.h&gt:&quot,&r),L;;圆球表面积;}去掉scanf里面多余的&quot.2f\n&quot:%lf\); printf(&quot,Vb); printf(&圆面积
其他类似问题
为您推荐:
c语言程序的相关知识
其他4条回答
scanf(&%f&)
多了一个},任何程序中的大括号{}和() 都是成对出现的,不能只出现一个。望采纳
最后面多了一个括号
最后面多了一个大括号。
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁求大神啊,看下这个程序哪错了_c语言吧_百度贴吧
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&签到排名:今日本吧第个签到,本吧因你更精彩,明天继续来努力!
本吧签到人数:0成为超级会员,使用一键签到本月漏签0次!成为超级会员,赠送8张补签卡连续签到:天&&累计签到:天超级会员单次开通12个月以上,赠送连续签到卡3张
关注:431,098贴子:
求大神啊,看下这个程序哪错了收藏
#include&stdio.h&#include&malloc.h&typedef struct node_type{ struct node_type *}node_typedef struct list_type{ node_type * node_type *}list_creat_list(){ node_type *p; list_ list.length=0; list.head=NULL; list.tail=NULL; p=malloc(sizeof(struct node_type)); scanf("%d",&p-&a); list.head=p; p-&next=list. list.length=list.length+1; p=malloc(sizeof(struct node_type)); scanf("%d",&p-&a); return(list.head);}printf_list(){ struct node_type *q; q= while(q!=NULL) {
printf("%d",q-&a);
}}void main(){ struct node_type *q; q=creat_list(); printf_list(q);}
---------- VC++ 2012 Compiler ----------F:\!tmp\_CCC\myCC\000&cl a1.c /Wall /D _CRT_SECURE_NO_WARNINGS
用于 x86 的 Microsoft (R) C/C++ 优化编译器 17.00.50727.1 版版权所有(C) Microsoft Corporation。保留所有权利。a1.ca1.c(14) : warning C4255: “creat_list”: 未给出函数原型: 将“()”转换为“(void)”a1.c(15) : warning C4431: 缺少类型说明符 - 假定为 int。注意: C 不再支持默认 inta1.c(28) : warning C4047: “return”:“int”与“node_type *”的间接级别不同a1.c(30) : warning C4255: “printf_list”: 未给出函数原型: 将“()”转换为“(void)”a1.c(31) : warning C4431: 缺少类型说明符 - 假定为 int。注意: C 不再支持默认 inta1.c(33) : error C2065: “head”: 未声明的标识符a1.c(33) : warning C4047: “=”:“node_type *”与“int”的间接级别不同a1.c(40) : warning C4255: “main”: 未给出函数原型: 将“()”转换为“(void)”a1.c(43) : warning C4047: “=”:“node_type *”与“int”的间接级别不同输出完成 (耗时 0 秒) - 正常终止
---------- MinGW-GCC ----------a1.c:14:1: warning: return type defaults to 'int' [enabled by default] creat_list() ^a1.c: In function 'creat_list':a1.c:28:1: warning: return makes integer from pointer without a cast [enabled by default] return(list.head); ^a1.c: At top level:a1.c:30:1: warning: return type defaults to 'int' [enabled by default] printf_list() ^a1.c: In function 'printf_list':a1.c:33:3: error: 'head' undeclared (first use in this function) q=
^a1.c:33:3: note: each undeclared identifier is reported only once for each function it appears ina1.c: At top level:a1.c:40:6: warning: return type of 'main' is not 'int' [-Wmain] void main()
^a1.c: In function 'main':a1.c:43:2: warning: assignment makes pointer from integer without a cast [enabled by default] q=creat_list();
^a1.c: In function 'printf_list':a1.c:39:1: warning: control reaches end of non-void function [-Wreturn-type] } ^输出完成 (耗时 2 秒) - 正常终止
函数定义不正确,void create_list()或者int create_list(),其他的也一样
好难。看不懂   -- 一个男人最大的失败不是没有女生喜欢他,而是喜欢过他的女生觉得自己当初瞎了眼。
#include&stdio.h&#include&malloc.h&typedef struct node_type{struct node_type *}node_typedef struct list_type{node_type *node_type *}list_node_type *creat_list(){node_type *p;list_list.length=0;list.head=NULL;list.tail=NULL;p=(node_type*)malloc(sizeof(node_type));scanf("%d",&p-&a);list.head=p;p-&next=list.list.length=list.length+1;p=(node_type*)malloc(sizeof(struct node_type));scanf("%d",&p-&a);return(list.head);}void printf_list(node_type *head){struct node_type *q;q=while(q!=NULL){printf("%d",q-&a);q=q-&}}int main(){struct node_type *q;q=creat_list();printf_list(q);return 0;}先打好基本功再学数据结构吧、错的我都不想说。。
登录百度帐号推荐应用
为兴趣而生,贴吧更懂你。或这个C语言程序哪里错了_百度知道
这个C语言程序哪里错了
Etemp\未命名5;C-Free Standard\
for(s=0;i&lt,a[j];temp&#92, 编译器类型.[Error] E: mingw2;);temp\C-Free Standard\}错误信息如下;C-Free Standard&#92,&n);temp\s& undeclared (first use this function)[Error] E;%d&quot:&#92: (Each undeclared identifier is reported only once[Error] E;未命名5.:&#92: `a'}int main(){%d\
sum+=a[j]: 4 个错误;.;未命名5;
return sum:4;
printf(& undeclared (first use this function)构建中止 未命名5:4.h&gt.temp\
j+=1:\i++)
if(number%i==0)
a[j]=i.正在编译 E:4;int xxx(int number){
int i:&#92,xxx(n))#include&s++)
sum=0;C-Free Standard\未命名5.cpp,number.95 - CUI Debug.cpp: MinGW (Old)--------------------检查文件依赖性:--------------------配置;
for(i=2.cpp.;;
return 0: for each fuj.)[Error] E:9:&
scanf(&quot:\n&C-Free Standard\未命名5.: `j&#39,s
这个程序是编写一个函数,计算一个正整数的所有的因子之和,例如72的所有因子之和为2+2+2+3+3=12
提问者采纳
i; scanf(&quot.h&0;& } return&n;);number)&Enter&}int&&%d& printf(&&i; printf(&%d\n&number,xxx(n));0;&0)
sum&xxx(int&main()&=&=&{ int&int&i&{
if(number%i&;n); return&nbsp,sum&2;{ int& for(i&nbsp:&a&i++)&nbsp#include&nbsp,&==&+=&
提问者评价
其他类似问题
为您推荐:
其他3条回答
sint i,这句里面的a[j]中的j在哪里呢?j是个未定义的变量,a[j]
程序改成下面这样,试试吧:#include&stdio.h&int xxx(int number,int
int i,s,sum,a[j];
for(i=2;i&i++)
if(number%i==0)
for(s=0;s&j;s++)
sum+=a[j];
}}int main(){I
printf(&Enter a number:&);
scanf(&%d&,&n);Printf(“Enter j:”);scanf(&%d&,&m);
printf(&%d\n&,xxx(n, m));
return 0;}
好像也不对啊
只是大致看了下,你的int 函数中j未定义,并且如果要a[j]这样使用的话,j应该赋初值
c语言程序的相关知识
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁

我要回帖

更多关于 流水灯c语言程序 的文章

 

随机推荐