上一页 1 ··· 71 72 73 74 75 76 77 78 79 ··· 188 下一页
摘要: #include <stdio.h> //求出a中各相邻两个元素的和,并将这些和存放在数组b中 //按每行3个元素的形式输出。例如:b[1]=a[1]+a[0],....,b[9]=a[9]+a[8] main() { int a[10],b[10],i; printf("\nInput 10 nu 阅读全文
posted @ 2023-02-09 19:44 myrj 阅读(85) 评论(0) 推荐(0)
摘要: #include <stdio.h> //输入一行英文,输出单词个数 #include <string.h> main() { char zf[101]; int a,b,【1】; 【1】; a=【1】; for(b=0;【1】;b++) if(zf[b]==【1】) c++; c=【1】; pri 阅读全文
posted @ 2023-02-09 15:25 myrj 阅读(46) 评论(0) 推荐(0)
摘要: #include <stdio.h> //输入5个1-9之间的整数,输出其中的最大值和最小值 main() { int a[5],i,j,temp,【1】; for(i=0;i<5;i++) scanf("%d",&a[i]); for(i=0;i<4;i++) for(j=【1】;j<5;j++) 阅读全文
posted @ 2023-02-09 15:19 myrj 阅读(145) 评论(0) 推荐(0)
摘要: #include <stdio.h> //从键盘输入一个年份和月份,输出该月的天数 main() { int year,month; scanf("【1】",&year,&month); switch(month) { case 1: case 3: case 5: case 7: case 8: 阅读全文
posted @ 2023-02-09 15:09 myrj 阅读(589) 评论(0) 推荐(0)
摘要: #include <stdio.h> //调用函数f,从字符串中删除所有的数字字符 asdf32asdfadsfds\0 数组 #include <string.h> void f(char *s) { int i=0; while(【1】) { if(s[i]>='0' && s[i]<='9') 阅读全文
posted @ 2023-02-09 10:36 myrj 阅读(274) 评论(0) 推荐(0)
摘要: #include <stdio.h> //调用函数计算代数多项式1.1+2.2*x+3.3*x*x+4.4*x*x*x+5.5*x*x*x*x //当x=1.7时的值 float f(float,float*,int) ; main() { float b[5]={1.1,2.2,3.3,4.4,5 阅读全文
posted @ 2023-02-09 10:28 myrj 阅读(86) 评论(0) 推荐(0)
摘要: #include <stdio.h> //程序功能:调用函数f,将一个整数首尾倒置 //如程序输入12345,则输出54321 // 如程序输入-12345,则输出-54321 #include <math.h> int f(int n) { int m,y=0;m=abs(n); while(m! 阅读全文
posted @ 2023-02-09 10:19 myrj 阅读(336) 评论(0) 推荐(0)
摘要: #include <stdio.h> //编写一个程序,输出1-1000间所有完全数 //如果一个数等于它的因子之和,则称该数为完数或完全数 //例如6=1+2+3,因此6是完数 int wqs(int n) { int a=0,b; for(b=1;【1】;b++) if(【2】) a=a+b; 阅读全文
posted @ 2023-02-09 09:41 myrj 阅读(206) 评论(0) 推荐(0)
摘要: #include <stdio.h> //编写一个程序,输入一个整数n,判断其是否为完数 //如果一个数等于它的因子之和,则称该数为完数或完全数 //例如6=1+2+3,因此6是完数 main() { int i,n,s; 【1】; scanf("%d",&n); for(i=1;【2】;i++) 阅读全文
posted @ 2023-02-09 09:28 myrj 阅读(171) 评论(0) 推荐(0)
摘要: #include <stdio.h> //->是一个整体,它是用于指向结构体子数据的指针,用来取子数据。 //换种说法,如果我们在C语言中定义了一个结构体,然后申明一个指针指向这个结构体, //那么我们要用指针取出结构体中的数据,就要用到->。 //计算四位学生的平均成绩,保存在结构体中,然后列表输 阅读全文
posted @ 2023-02-08 21:00 myrj 阅读(132) 评论(0) 推荐(0)
上一页 1 ··· 71 72 73 74 75 76 77 78 79 ··· 188 下一页