tzkr.net
当前位置:首页 >> 一道C语言编程题,数组课后作业:编程实现从键盘任... >>

一道C语言编程题,数组课后作业:编程实现从键盘任...

#include void main() { int s[20],a,n=0,i,sum=0; printf("请输入20个整数:\n"); for(i=0;i

你好,这是我写的,望采纳:

#includeint main(){int a[10000],i=0,j,k,l; printf("Please input numbers:"); while(scanf("%d",&k)) { if(k==-222) break; a[i]=k; i++; } for(j=0;j

#include #include int main(){ char *a[] = {"鼠","牛","虎","兔","龙","蛇","马","羊","猴","鸡","狗","猪"}; int year, y; scanf("%d", &year); y = year < 0 ? year + 1: year; // 注意:没有公元0年,公元前1年紧接着公元1年 while (y < 0)...

给,已经编译运行确认: #include #include int main() { int a[11]={0}; int num; int i,j,t; printf("请输入10个数: \n"); for(i=0;i

思路:定义一个数组a用来存储需要统计的数组,再定义一个数组b用来统计0-9数组出现的个数,for循环a数组进行统计,最后输出b数组。 参考代码: #includeint main(){int i,a[20]={1,2,3,4,8,5,6,7,0,1,2,4,5,6,4,0,9,7,5,2},b[10]={0}; for(i=0;i

这个真不会啊呵呵

#include int main(void){int a[10]={1,2,3,4,5,6,7,8,9,10};int i,k;scanf("%d",&k);for(i=0;i

#include void main() { int a[10]; int i,j,max,min,temp,m,n; printf("请输入十个整数\n"); for(i=0;i

#include #include int main() { char str[5][80]; char temp[80]; int i,j; printf("Please input 5 strings:\n"); for (i=0;i

网站首页 | 网站地图
All rights reserved Powered by www.tzkr.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com