Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
这段代码为什么不过呢……#include <stdio.h> #include <stdlib.h> #include <math.h> int main(){ int n; int n1=0,n2=0; scanf("%d",&n); n1=n,n2=n-n1; while(1){ n1--; n2=n-n1; if(n1==n2) break; else if(abs(n1-n2)==1) break; } if(n1>n2) printf("%d %d",n1,n2); else printf("%d %d",n2,n1); system("pause"); return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator