摘要: #include int gcd(int a,int b){ if (b==0) return a; else return gcd(b,a%b);}int main(){ int m,n; while (scanf("%d%d",&m,&n)!=EOF) { printf("%d\n",m*n/gcd(m,n)); } return 0;} 阅读全文
posted @ 2013-12-25 16:49 forever97 阅读(239) 评论(0) 推荐(0) 编辑
摘要: #include #include using namespace std;int main(){ int n; while(scanf("%d",&n)!=EOF) { int a[100000]; for(int i=0; i<n; i++) scanf("%d",&a[i]); sort(a,a+n); printf("%d\n",a[n/2]); } return 0;} 阅读全文
posted @ 2013-12-25 16:40 forever97 阅读(123) 评论(0) 推荐(0) 编辑
摘要: #include #include #include using namespace std;struct cc{ int id; int mark;}a[10000];bool cmp(cc a,cc b) {return (a.mark>b.mark);} int main(){ int m,n; while(scanf("%d",&n)!=EOF) { int i=0; while(scanf("%d%d",&a[i].id,&a[i].mark),a[i].id!=0) i++; int s=i; s... 阅读全文
posted @ 2013-12-25 16:29 forever97 阅读(102) 评论(0) 推荐(0) 编辑