填空题

以下程序的功能是计算:s=1+12+123+1234+12345。请填空。 main() { int t=0,s=0,i; for(i=1;i<=5;i++) {t=i+ 【10】 ;s=s+t; } printf("s=%d\n",s); }

【参考答案】

t*10或10*t
<上一题 目录 下一题>
热门 试题

填空题
以下程序的输出结果是 【9】 。#include <stdio.h>main(){ int n=12345,d;while(n!=0){ d=n%10; printf( %d ,D) ; n =10; }}
填空题
以下函数fun的功能是返回str所指字符串中以形参c中字符开头的后续字符串的首地址,例如;str所指字符串为:Hello!,c中的字符为e,则函数返回字符串:ello!的首地址。若str所指字符串为空串或不包含c中的字符,则函数返回NULL。请填空。char*fun(char *str,char c) { int n=0; char *p=str;if(p!=NULL)while(p[n]!=c && p[n]!=’ O’)n++;if(p[n]=’ 0’) return NULL;return( 【12】 );}
相关试题
  • 以下程序中函数huiwen的功能是检查一个字符...