随笔分类 - 杂题
杭电 1108 最小公倍数
摘要:#include<stdio.h>#include<string.h>#include<stdlib.h>int gcd(int x,int y){ return y==0 ? x : gcd(y,x%y);}int main(){ int a,b,lim; while(scanf("%d%d",&a,&b)!=EOF) { lim=(a*b)/gcd(a,b); printf("%d\n",lim); } //system("pause"); return 0;}
阅读全文
学生成绩管理系统
摘要:#include<stdio.h>#include<string.h>#include<stdlib.h>#define MAXSIZE 100int n,m;typedef struct { char name[20]; int num; int yuwen; int shuxue; int yinyu;}DataType;typedef struct { DataType data[MAXSIZE]; int last;}seqlist;seqlist *A1,*A2,*A3,*A4,*A6;struct In{ int sum; int nums; c
阅读全文
小测试
摘要:通过这个测试可知:在初始化赋值时,不能连续赋值,然而在分开定义后,在进行额外赋值时,可以连续赋值。#include<stdio.h>#include<stdlib.h>int main(){ /*int a=b=1;*///wrong int a,b;//right a=b=1; printf("%d %d\n",a,b); system("pause"); return 0;}
阅读全文