两道c语言题 帮忙回答一下吧

[复制链接]
查看11 | 回复1 | 2009-8-26 15:03:21 | 显示全部楼层 |阅读模式
1.#includeint main(){ int i; long temp = 1L; long sum = 0; for(i = 1; i void scopy(char s1[], char s2[]){ while(*s2 != '\0') {*s1 = *s2;
s1++;s2++; } *s1 = '\0';}void main( ){ char b[20]="Hello",a[20]; scopy(a, b); printf("%s",a);}
回复

使用道具 举报

千问 | 2009-8-26 15:03:21 | 显示全部楼层
第一题:void main(){ int i,j; unsigned long m,s=0; for(i=1;i<=10;i++) { m=1; for(j=1;j<=i;j++)
m*=j; s+=m; } printf("s=%ld",s);}第二题:void scopy(char s1[], char s2[]){ int i; for(i=0;s2!='\0';i++) {
s1=s2; } s1='\0';}
回复

使用道具 举报

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

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行