摘要: #include <stdio.h> #include <stdlib.h> #define N 10 typedef struct student { int num; char name[20]; int score; }STU; int main() { STU st, stmax, stmi 阅读全文
posted @ 2020-12-31 12:12 编程同学入魔了 阅读(30) 评论(2) 推荐(0) 编辑
摘要: #include<stdio.h> #include<stdlib.h> #include<string.h> #define N 3 typedef struct student{ int id; char name[20]; char subject[20]; float perf; float 阅读全文
posted @ 2020-12-21 23:40 编程同学入魔了 阅读(52) 评论(3) 推荐(0) 编辑
摘要: #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] 阅读全文
posted @ 2020-12-16 22:18 编程同学入魔了 阅读(33) 评论(3) 推荐(0) 编辑
摘要: #include<stdio.h> #include<math.h> void solve(double a,double b,double c); int main(){ double a,b,c; printf("enter a,b,c:"); while(scanf("%1f%1f%1f",& 阅读全文
posted @ 2020-12-02 12:26 编程同学入魔了 阅读(61) 评论(5) 推荐(0) 编辑
摘要: //一元二次方程求解 //重复执行,直到按ctrl+z2结束 // #include <math.h> #include<stdio.h> int main(){ float a,b,c,x1,x2; float delta,real,imag; printf("Enter a, b, c: "); 阅读全文
posted @ 2020-11-18 13:12 编程同学入魔了 阅读(84) 评论(2) 推荐(0) 编辑
摘要: // ex1.cpp #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; } //ex2.cpp 阅读全文
posted @ 2020-11-05 23:49 编程同学入魔了 阅读(41) 评论(3) 推荐(0) 编辑
摘要: /* A simple C program */ #include <stdio.h> int main() { printf("my stuno is:202083290266\n"); printf("2020,well done"); return 0; } /* 用C语言实现的一个简单算术运 阅读全文
posted @ 2020-10-18 22:44 编程同学入魔了 阅读(48) 评论(2) 推荐(0) 编辑