摘要:
View Code #include"iostream"using namespace std;int main(){ int n; int a,b,c; int sum; int i,j; cin>>n; while(n--) { cin>>a>>b>>c; if(b>=c) cout<<"Yes"<<endl; else { if(a==0) cout<<"No"<<endl; else if(a>0&&a& 阅读全文
posted @ 2011-04-07 17:31
聊聊IT那些事
阅读(261)
评论(0)
推荐(0)
摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=1256View Code #include"iostream"using namespace std;int n,m;int i,j;char a[10];int y; int d; // d表示行的宽度void fun1(){ for( i=0;i<d-y;i++) { if(i<m/6+1) printf(" "); else printf("%s",a); } printf("\n");}void fun2(in 阅读全文
posted @ 2011-04-07 17:07
聊聊IT那些事
阅读(391)
评论(0)
推荐(0)
摘要:
枚举法。。。。View Code #include"iostream"#define M 1000001using namespace std;int a[M];int main(){ int m,n; int i; memset(a,0,sizeof(a)); for(i=1;i<=1000001;i++) { int x=i; int k=i; while(x) { if(x%10==4||x%100==62){ a[k]=1; } x/=10; } } while(cin>>m>>n,m+n) { int flag=0; for(i=m; 阅读全文
posted @ 2011-04-07 16:00
聊聊IT那些事
阅读(291)
评论(0)
推荐(0)
摘要:
产生冠军的条件:(1)获胜的人没输过一次(2)最终获胜的人只有一个View Code #include"iostream"//#include"algorithm"using namespace std;#define M 1010int main(){ int n; int i,j; char a[M][100],b[M][100]; int sum[M],c[M]; while(cin>>n,n) { memset(sum,0,sizeof(sum)); //0表示失败 for(i=0;i<n;i++) { cin>>a 阅读全文
posted @ 2011-04-07 09:34
聊聊IT那些事
阅读(648)
评论(0)
推荐(0)