include stdio h define SUM 100000int main float amount aver total int i for i 1 total 0 i 1000 i printf please enter amount scanf f amount total total amount if total SUM break aver total i printf num d naver 10 2f n i aver return 0
举一反三
- 下列程序运行时输入:20 30 5 85 40,运行结果为: #include #define N 5 int main(void) { int a[N],max,min,sum,i; for (i=0;i scanf("%d",&a[i]); sum=max=min=a[0]; for (i=1;i { sum+=a[i]; if (a[i]>max) max=a[i]; if (a[i] } printf("max=%d min=%d sum=%d aver=%4.2f ",max,min,sum,(float)(sum-max-min)/(N-2)); return 0; }
- 【填空题】/*------------------------------------------------------- 功能:以每行5 个数来输出300 以内能被7 或17 整除的偶数,并求出其和。 -------------------------------------------------------*/ #include "stdio.h" main() { int i,n,sum; sum=0; ________________; for(i=1; ________________ ;i++) if(________________) if(i%2==0) { sum=sum+i; n++; printf("%6d",i); if(________________) printf(" "); } printf(" total=%d",sum); }
- What does the FREQ column show when running the tprof option? () A: Total amount of Ticks used by all users B: Total amount of Ticks used by all processes C: Total amount of Ticks used by a specific user D: Total amount of Ticks used by a specific type of proce
- What does the FREQ column show when running the tprof option?() A: Total amount of Ticks used by all users B: Total amount of Ticks used by all processes C: Total amount of Ticks used by a specific user D: Total amount of Ticks used by a specific type of process
- 下面程序可以正确求出1+2+3+。。。+n的和。() #include int main( ) { int i = 1,sum = 0,n; scanf(“%d”,&n); while (i <= n) sum = sum + i; ++i; printf("sum=%d