摘要: ex3 是;是;是;是 ex4 (1)是;是;否 (2) #include<stdio.h>#include <stdlib.h>#define N 10// 定义一个结构体类型STU typedef struct student { int num; char name[20]; int scor 阅读全文
posted @ 2020-12-31 12:46 星冉 阅读(46) 评论(2) 推荐(0)
摘要: ex1 #include<stdio.h> #include<stdlib.h> #include<string.h> #define N 4 typedef struct student { int id; char name[20]; char subject[20]; float perf; 阅读全文
posted @ 2020-12-20 21:37 星冉 阅读(68) 评论(0) 推荐(0)
摘要: ex1 #include <stdio.h> const int N=3; int main() { int a[N]={1,2,3}; int i; printf("通过数组名及下标直接访问数组元素:\n"); for(i=0;i<N;i++) printf("%d: %d\n",&a[i],a[ 阅读全文
posted @ 2020-12-08 10:07 星冉 阅读(131) 评论(1) 推荐(0)
摘要: ex1 应该可以,x1,x2要转换成字符串的形式 ex2 #include <stdio.h> long long fac(int n); int main() { int i,n; printf("Enter n: "); scanf("%d",&n); for(i=1;i<=n;++i) pri 阅读全文
posted @ 2020-11-25 22:33 星冉 阅读(26) 评论(0) 推荐(0)
摘要: ex1 #include <stdio.h> #include <math.h> int main() { float a,b,c,x1,x2; float delta,real,imag; printf("Enter a,b,c: "); while(scanf("%f%f%f",&a,&b,&c 阅读全文
posted @ 2020-11-13 23:56 星冉 阅读(83) 评论(0) 推荐(0)
摘要: ex1 #include <stdio.h> int main () { int a=5,b=7,c=100,d,e,f; d=a/b*c; e=a*c/b; f=c/b*a; printf("d=%d, e=%d, f=%d\n",d,e,f); return 0; } d=5/7*100=int 阅读全文
posted @ 2020-10-29 20:12 星冉 阅读(82) 评论(0) 推荐(1)
摘要: #include <stdio.h> int main() { printf("my stuno is: 202083290322\n2020, r u crazy?"); return 0; } ex2 #include <stdio.h> int main() { while(1) printf 阅读全文
posted @ 2020-10-15 18:42 星冉 阅读(24) 评论(0) 推荐(0)