[理学]C程序设计第四版谭浩强第6章数组.pptVIP

  • 10
  • 0
  • 约1.2万字
  • 约 33页
  • 2018-03-02 发布于浙江
  • 举报

[理学]C程序设计第四版谭浩强第6章数组.ppt

[理学]C程序设计第四版谭浩强第6章数组

第六章 例 输入85个学生的英语成绩,求平均分 例5.9求Fibonacci数列前40个数。 #include stdio.h void main() { long int f1,f2, f; int i; f1=1;f2=1; printf(“%12ld %12ld”,f1,f2); for(i=3; i=40; i++) { f=f1+f2; f1 = f2; f2 = f; printf(″%12ld ″,f); if(i%5==0) printf(″\n″); } } #include string.h #include stdio.h main() { char str1[] = ”Hello!, str2[] = ”How are you?”,str[20]; int len1,len2,len3; len1=strlen(str1); len2=strlen(str2); if(strcmp(str1, str2)0) { strcpy(str,str1); strcat(str,str2); } else if (strcmp(

文档评论(0)

1亿VIP精品文档

相关文档