摘要:
#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;} 阅读全文
摘要:
#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;} 阅读全文
摘要:
#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... 阅读全文