08 2018 档案

摘要:#include <stdio.h>#include <string.h>void main(){ struct staff { char name[20]; char department[20]; int salary; int cost; }worker[3]= { {"Xu_Guo","pa 阅读全文
posted @ 2018-08-20 19:18 唉蒙程灵素 阅读(292) 评论(0) 推荐(0) 编辑
摘要://判断一个数是不是素数#include <stdio.h>int main(){ int t; while(1) { scanf("%d",&t); int i,x,z=0; for(i=1;i<t;i++) { x=t%i; if(x==0) z++; } if(z<2) printf("该数是 阅读全文
posted @ 2018-08-18 16:42 唉蒙程灵素 阅读(203) 评论(2) 推荐(0) 编辑
摘要:#include <stdio.h>#include <conio.h>void main(){ struct stuscore { char name[20]; float score[5]; float average; }x; int i; float sum; char rep; while 阅读全文
posted @ 2018-08-17 19:42 唉蒙程灵素 阅读(597) 评论(0) 推荐(0) 编辑
摘要:#include <stdio.h>#include <stdlib.h>int main(int argc, char const *argv[]){ int number; int i; int*a; scanf("%d",&number); //int a[number]; a=malloc( 阅读全文
posted @ 2018-08-16 16:36 唉蒙程灵素 阅读(267) 评论(0) 推荐(0) 编辑
摘要:#include <stdio.h>int main(){ int x; scanf("%d",&x); int t; int ret=0;do { t=x%10; ret=ret*10+t; x/=10; }while(x>0); printf("%d",ret);} 阅读全文
posted @ 2018-08-15 19:06 唉蒙程灵素 阅读(243) 评论(0) 推荐(0) 编辑
摘要:#include <stdio.h>#include <stdlib.h>#include <time.h>int main(){ int x,n=0; srand(time(0)); int number=rand()%100; //printf("%d\n",&number); printf(" 阅读全文
posted @ 2018-08-15 16:51 唉蒙程灵素 阅读(137) 评论(0) 推荐(0) 编辑
摘要:#include <stdio.h>int main(){ long int t,x,y,ret=0; printf("底和真数:\n"); scanf("%d%d",&x,&y); t=y; while(y>x) { y/=x; ret++; } printf("log %d of %d is % 阅读全文
posted @ 2018-08-15 15:24 唉蒙程灵素 阅读(460) 评论(0) 推荐(0) 编辑
摘要:#include <stdio.h>int main(){ int a; scanf("%d",&a); int n=1; a=a/10; while(a>0) { a=a/10; n++; } printf("%d",n);} 阅读全文
posted @ 2018-08-15 11:28 唉蒙程灵素 阅读(199) 评论(0) 推荐(0) 编辑
摘要:#include <stdio.h>#define N 3 /*数字3为数据的长短*/ void main(){ int i,j,t; int a[N]; for(i=0;i<N;i++) scanf("%d",&a[i]); printf("待排数据:"); for(i=0;i<N;i++) pr 阅读全文
posted @ 2018-08-14 19:20 唉蒙程灵素 阅读(159) 评论(0) 推荐(1) 编辑
摘要:system函数的两个简单应用 1.调用cmd命令。例:(打开计算器) #include <stdlib.h> int main() { system("calc"); return 0; } 2.通过路径打开程序。例:(打开装在D盘桌面文件夹下的Firefox) #include <stdlib. 阅读全文
posted @ 2018-08-13 11:21 唉蒙程灵素 阅读(204) 评论(0) 推荐(1) 编辑