Search found 6 matches

by zzylhy
Thu May 22, 2003 5:23 pm
Forum: Volume 7 (700-799)
Topic: 737 - Gleaming the Cubes
Replies: 6
Views: 2802

Still WA

#include<iostream> using namespace std; int main() { int n,i; long x,y,z,x0,y0,z0,x1,y1,z1,vol,dis; while(1) { cin>>n; if(n==0) break; cin>>x>>y>>z>>dis; x0=x; y0=y; z0=z; x1=x+dis; y1=y+dis; z1=z+dis; for(i=2;i<=n;i++) { cin>>x>>y>>z>>dis; if(x>x1||x0>x+dis||y>>y1||y0>y+dis||z>z1||z0>z+dis) cout<<"...
by zzylhy
Wed May 21, 2003 4:50 pm
Forum: Volume 7 (700-799)
Topic: 737 - Gleaming the Cubes
Replies: 6
Views: 2802

737 - Gleaming the Cubes

#include<iostream> using namespace std; int main() { int n,i; long x,y,z,x0,y0,z0,x1,y1,z1,vol,dis; while(1) { cin>>n; if(n==0) break; cin>>x>>y>>z>>dis; x0=x; y0=y; z0=z; x1=x+dis; y1=y+dis; z1=z+dis; for(i=2;i<=n;i++) { cin>>x>>y>>z>>dis; if(x0<x) x0=x; if(x1>x+dis) x1=x+dis; if(y0<y) y0=y; if(y1>...
by zzylhy
Wed May 21, 2003 4:21 pm
Forum: Volume 2 (200-299)
Topic: 264 - Count on Cantor
Replies: 47
Views: 13336

264

#include<iostream.h> #include<stdio.h> int main() { long l,r,n,i; int sl,sr; while(cin>>n) { l=r=i=sr=sl=1; while(1) { if(i==n) break; if(l==1) { r++; i++; if(i==n) break; sl=1; sr=-1; while(r!=1) { l=l+sl; r=r+sr; i++; if(i==n) break; } } if(i==n) break; if(r==1) { l++; i++; if(i==n) break; sl=-1; ...
by zzylhy
Tue May 20, 2003 1:19 pm
Forum: Volume 5 (500-599)
Topic: 537 - Artificial Intelligence?
Replies: 76
Views: 10347

537

#include<iostream.h> #include<stdio.h> #include<string.h> #include<math.h> int main() { int n,count=0,k,len,fi,fp,fu,j; long double p,u,i; char s[100]; scanf("%d\n",&n); while(n>0) { count++; n--; fi=fu=fp=0; gets(s); len=strlen(s); k=0; p=u=i=0; while(k<len) { if((s[k]=='I')&&(s[k+1]=='=')) { fi=1;...
by zzylhy
Tue May 20, 2003 1:02 pm
Forum: Volume 102 (10200-10299)
Topic: 10282 - Babelfish
Replies: 48
Views: 19222

10282

#include<iostream.h> #include<string.h> #include<stdio.h> class node { public: node(); ~node(){}; char s[10],t[10]; node *next; }; node::node() { int i; for(i=0;i<11;i++) { s ='\0'; t ='\0'; } } node *creat() { node *h,*p,*q; char u[22],ch; h=new node(); p=h; while(1) { q=new node(); q->s[0]=getchar...
by zzylhy
Tue May 20, 2003 12:38 pm
Forum: Volume 6 (600-699)
Topic: 673 - Parentheses Balance
Replies: 243
Views: 44869

673

#include<iostream.h> #include<stdio.h> int main() { int n,i; char s[130],ch,flag; cin>>n; while(n>0) { n--; i=0; flag=1; while(1) { ch=getchar(); if(ch==10) break; else if((ch=='(')||(ch=='[')) { i++; s =ch; } else { if(i==0) { i=1; ch=getchar(); if(ch==10) break; } if(((ch==']')&&s =='[')||((ch==')...

Go to advanced search