首页 >>  正文

c语言编程题库100题及答案

来源:baiyundou.net   日期:2024-07-05

桂蓓甄4642C语言编程题
成朱实17775147111 ______ void fun(int *a,int *n) { int s = 0; for (int i=1; i<=100; i++) { if ( (i%13==0 || i%5==0) && i%65!=0 ) { a[s++] = i; } } *n = s; }

桂蓓甄4642C语言编程题
成朱实17775147111 ______ 1.#include <stdio.h> void main() { int x,y,z,t; printf("请输入三个整数"); scanf("%d%d%d",&x,&y,&z); if(x>y) {t=x;x=y;y=t;} else if(y>z){t=y;y=z;z=t;} printf("排序后的整数为:%d,%d,%d\n",x,y,z); } 2.#include <stdio.h>//把100-200(含100与...

桂蓓甄4642C语言程序设计题 -
成朱实17775147111 ______ #include#include main(){ int i=0; double s=0,x=0; for(i=1;s<=8;i++) { x = 1.0/i; s += x; } printf("s = %lf,n = %d\n",8 - (s - x) ...

桂蓓甄4642c语言编程题
成朱实17775147111 ______ include<stdio.h> int main() { int x; scanf("%d",&x); if(x<60) printf("E"); if(x>=60&&x<70) printf("D"); if(x>=70&&x<80) printf("C"); if(x>=80&&x<90) printf("B"); if(x>=90&&x<=100) printf("A"); return 0; }

桂蓓甄4642C语言编程题 -
成朱实17775147111 ______ #include int main(){ int i[5][5],x,y,a,b,*c[2]; printf("请输入5*5阵列组数据:\n"); for(b=0;b<2;b++)c[b]=0; for(a=0;a<25;a++) { x=a/5,y=a%5; scan...

桂蓓甄4642C语言编程题
成朱实17775147111 ______ 这个简单`我刚好遇到过! 第一题: # include <stdio.h> # include <math.h> void main () { float a,b,c,d,s;//设输入的3个边长a,b,c能构成三角形 scanf("%f,%f,%f",&a,&b,&c); d=1.0/2*(a+b+c); s=sqrt(d*(d-a)*(d-b)*(d-c));//海拉公式 printf("s=%7.2f",s); } 第2题想想喔!

桂蓓甄4642c语言编程题3
成朱实17775147111 ______ 第一个: #include<stdio.h> #include<math.h> int main( ) { char s1[80],s2[40]; /*s2连接在s1后面,s1应足够大*/ int i=0,j=0; printf("\nInput string1: "); scanf("%s",s1); /*输入串s1*/ printf("Input string2: "); scanf("%s",s2); /*输入串s2*/ ...

桂蓓甄4642C语言 编程题
成朱实17775147111 ______ //如果字符串长度在运行前就知道 #include <stdio.h> int main(){char s1[100],s2[100];int i;gets(s1);for(i=0;i<100;i++){s2[i]=s1[i];if(s1[i]=='\0')break;}printf("s2= ");puts(s2);} //如果字符串长度在运行时才能知道 #include <stdio.h> #include <stdlib.h> ...

桂蓓甄4642c语言程序设计习题 -
成朱实17775147111 ______ main() {int a=100,x =10,y=20,okl=5,ok2=0; if (x<y) { if(y ! =10) { if(!okl) a=1; }} else if(ok2) { a=10; } a=-1: printf( ...

桂蓓甄4642编程C语言题 -
成朱实17775147111 ______ #include using namespace std ;int count[10] = {0} ;void Picknum(char num[], char *p){ p = num ; while(*p!= '\0') { char ch = *p ; swit...

(编辑:自媒体)
关于我们 | 客户服务 | 服务条款 | 联系我们 | 免责声明 | 网站地图 @ 白云都 2024