返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     int a=0,b=0,c=0,d=0,e=0,f=0,g=0,h=0,z;
  7.     srand(time(NULL));
  8.     cout<<"1.Harry Poter     "<<endl;
  9.     cout<<"2.Ron Weasley     "<<endl;
  10.     cout<<"3.Cedric Diggory  "<<endl;
  11.     cout<<"4.Draco Malfoy    "<<endl;
  12.     cout<<"5.Cho Chang       "<<endl;
  13.     cout<<"6.Fred Weasley    "<<endl;
  14.     cout<<"7.George Weasley  "<<endl;
  15.     cout<<"8.Ginny Weasley   "<<endl;
  16.     system("pause");
  17.     cout<<"Broomstick fling a match of Hogwarts"<<endl;
  18.     cout<<"---------------------------------------------------------|win"<<endl;
  19.     cout<<"1"<<endl;
  20.     cout<<"2"<<endl;
  21.     cout<<"3"<<endl;
  22.     cout<<"4"<<endl;
  23.     cout<<"5"<<endl;
  24.     cout<<"6"<<endl;
  25.     cout<<"7"<<endl;
  26.     cout<<"8"<<endl;
  27.     system("pause");
  28.     system("cls");
  29.     while(a<=65 && b<=65 && c<=65 && d<=65 && e<=65 && f<=65 && g<=65 && h<=65)
  30.     {
  31.       z=rand()%8+1;
  32.       if(z==1)   
  33.        a++;
  34.       else if(z==1)   
  35.        b++;
  36.       else if(z==1)   
  37.        c++;
  38.       else if(z==1)   
  39.        d++;
  40.       else if(z==1)   
  41.        e++;
  42.       else if(z==1)   
  43.        f++;
  44.       else if(z==1)   
  45.        g++;
  46.       else  
  47.        h++;
  48.       cout<<"RUN"<<endl;
  49.       cout<<"---------------------------------------------------------|win"<<endl;
  50.       for(int i=0;i<=a;i++)
  51.         cout<<" "<<endl;
  52.       cout<<"1"<<endl;
  53.       for(int i=0;i<=b;i++)
  54.         cout<<" "<<endl;
  55.       cout<<"2"<<endl;
  56.       for(int i=0;i<=c;i++)
  57.         cout<<" "<<endl;
  58.       cout<<"3"<<endl;
  59.       for(int i=0;i<=d;i++)
  60.         cout<<" "<<endl;
  61.       cout<<"4"<<endl;
  62.       for(int i=0;i<=e;i++)
  63.         cout<<" "<<endl;
  64.       cout<<"5"<<endl;
  65.       for(int i=0;i<=f;i++)
  66.         cout<<" "<<endl;
  67.       cout<<"6"<<endl;
  68.       for(int i=0;i<=g;i++)
  69.         cout<<" "<<endl;
  70.       cout<<"7"<<endl;
  71.       for(int i=0;i<=h;i++)
  72.         cout<<" "<<endl;
  73.       cout<<"8"<<endl;
  74.       system("cls");
  75.     }
  76.     cout<<"over"<<endl;
  77.     cout<<"---------------------------------------------------------|win"<<endl;
  78.     for(int i=0;i<=a;i++)
  79.       cout<<" "<<endl;
  80.     cout<<"1"<<endl;
  81.     for(int i=0;i<=b;i++)
  82.       cout<<" "<<endl;
  83.     cout<<"2"<<endl;
  84.     for(int i=0;i<=c;i++)
  85.       cout<<" "<<endl;
  86.     cout<<"3"<<endl;
  87.     for(int i=0;i<=d;i++)
  88.       cout<<" "<<endl;
  89.     cout<<"4"<<endl;
  90.     for(int i=0;i<=e;i++)
  91.       cout<<" "<<endl;
  92.     cout<<"5"<<endl;
  93.     for(int i=0;i<=f;i++)
  94.       cout<<" "<<endl;
  95.     cout<<"6"<<endl;
  96.     for(int i=0;i<=g;i++)
  97.       cout<<" "<<endl;
  98.     cout<<"7"<<endl;
  99.     for(int i=0;i<=h;i++)
  100.       cout<<" "<<endl;
  101.     cout<<"8"<<endl;
  102.     system("pause");
  103.     return 0;
  104. }
複製代碼

TOP

本帖最後由 tonyh 於 2015-7-18 11:22 編輯
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     int a=0,b=0,c=0,d=0,e=0,f=0,g=0,h=0,z;
  7.     srand(time(NULL));
  8.     cout<<"1.Harry Poter     "<<endl;
  9.     cout<<"2.Ron Weasley     "<<endl;
  10.     cout<<"3.Cedric Diggory  "<<endl;
  11.     cout<<"4.Draco Malfoy    "<<endl;
  12.     cout<<"5.Cho Chang       "<<endl;
  13.     cout<<"6.Fred Weasley    "<<endl;
  14.     cout<<"7.George Weasley  "<<endl;
  15.     cout<<"8.Ginny Weasley   "<<endl;
  16.     system("pause");
  17.     system("cls");
  18.     cout<<"Broomstick fling a match of Hogwarts"<<endl;
  19.     cout<<"-----------------------------------------------------------------------|win"<<endl;
  20.     cout<<"1"<<endl;
  21.     cout<<"2"<<endl;
  22.     cout<<"3"<<endl;
  23.     cout<<"4"<<endl;
  24.     cout<<"5"<<endl;
  25.     cout<<"6"<<endl;
  26.     cout<<"7"<<endl;
  27.     cout<<"8"<<endl;
  28.     system("pause");
  29.     system("cls");
  30.     while(a<=65 && b<=65 && c<=65 && d<=65 && e<=65 && f<=65 && g<=65 && h<=65)
  31.     {
  32.       z=rand()%8+1;
  33.       if(z==1)   
  34.        a++;
  35.       else if(z==2)   
  36.        b++;
  37.       else if(z==3)   
  38.        c++;
  39.       else if(z==4)   
  40.        d++;
  41.       else if(z==5)   
  42.        e++;
  43.       else if(z==6)   
  44.        f++;
  45.       else if(z==7)   
  46.        g++;
  47.       else  
  48.        h++;
  49.       cout<<"RUN"<<endl;
  50.       cout<<"-----------------------------------------------------------------------|win"<<endl;
  51.       for(int i=0;i<=a;i++)
  52.         cout<<" ";
  53.       cout<<"1"<<endl;
  54.       for(int i=0;i<=b;i++)
  55.         cout<<" ";
  56.       cout<<"2"<<endl;
  57.       for(int i=0;i<=c;i++)
  58.         cout<<" ";
  59.       cout<<"3"<<endl;
  60.       for(int i=0;i<=d;i++)
  61.         cout<<" ";
  62.       cout<<"4"<<endl;
  63.       for(int i=0;i<=e;i++)
  64.         cout<<" ";
  65.       cout<<"5"<<endl;
  66.       for(int i=0;i<=f;i++)
  67.         cout<<" ";
  68.       cout<<"6"<<endl;
  69.       for(int i=0;i<=g;i++)
  70.         cout<<" ";
  71.       cout<<"7"<<endl;
  72.       for(int i=0;i<=h;i++)
  73.         cout<<" ";
  74.       cout<<"8"<<endl;
  75.       system("cls");
  76.     }
  77.     cout<<"over"<<endl;
  78.     cout<<"--------------------------------------------------------------------|win"<<endl;
  79.     for(int i=0;i<=a;i++)
  80.       cout<<" ";
  81.     cout<<"1"<<endl;
  82.     for(int i=0;i<=b;i++)
  83.       cout<<" ";
  84.     cout<<"2"<<endl;
  85.     for(int i=0;i<=c;i++)
  86.       cout<<" ";
  87.     cout<<"3"<<endl;
  88.     for(int i=0;i<=d;i++)
  89.       cout<<" ";
  90.     cout<<"4"<<endl;
  91.     for(int i=0;i<=e;i++)
  92.       cout<<" ";
  93.     cout<<"5"<<endl;
  94.     for(int i=0;i<=f;i++)
  95.       cout<<" ";
  96.     cout<<"6"<<endl;
  97.     for(int i=0;i<=g;i++)
  98.       cout<<" ";
  99.     cout<<"7"<<endl;
  100.     for(int i=0;i<=h;i++)
  101.       cout<<" ";
  102.     cout<<"8"<<endl;
  103.     system("pause");
  104.     return 0;
  105. }
複製代碼
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     int a=0,b=0,c=0,d=0,e=0,f=0,g=0,h=0,z;
  7.     srand(time(NULL));
  8.    
  9.     cout<<"Broomstick fling a match of Hogwarts"<<endl;
  10.     cout<<"---------------------------------------------------------|win"<<endl;
  11.     cout<<"1"<<endl;
  12.     cout<<"2"<<endl;
  13.     cout<<"3"<<endl;
  14.     cout<<"4"<<endl;
  15.     cout<<"5"<<endl;
  16.     cout<<"6"<<endl;
  17.     cout<<"7"<<endl;
  18.     cout<<"8"<<endl;
  19.     cout<<endl;
  20.       
  21.     cout<<"1.Harry Poter     "<<endl;
  22.     cout<<"2.Ron Weasley     "<<endl;
  23.     cout<<"3.Cedric Diggory  "<<endl;
  24.     cout<<"4.Draco Malfoy    "<<endl;
  25.     cout<<"5.Cho Chang       "<<endl;
  26.     cout<<"6.Fred Weasley    "<<endl;
  27.     cout<<"7.George Weasley  "<<endl;
  28.     cout<<"8.Ginny Weasley   "<<endl;
  29.     cout<<endl;
  30.     system("pause");
  31.     system("cls");
  32.     while(a<=65 && b<=65 && c<=65 && d<=65 && e<=65 && f<=65 && g<=65 && h<=65)
  33.     {
  34.       z=rand()%8+1;
  35.       if(z==1)   
  36.        a++;
  37.       else if(z==2)   
  38.        b++;
  39.       else if(z==3)   
  40.        c++;
  41.       else if(z==4)   
  42.        d++;
  43.       else if(z==5)   
  44.        e++;
  45.       else if(z==6)   
  46.        f++;
  47.       else if(z==7)   
  48.        g++;
  49.       else  
  50.        h++;
  51.       cout<<"RUN"<<endl;
  52.       cout<<"---------------------------------------------------------|win"<<endl;
  53.       for(int i=0;i<=a;i++)
  54.         cout<<" ";
  55.       cout<<"1"<<endl;
  56.       for(int i=0;i<=b;i++)
  57.         cout<<" ";
  58.       cout<<"2"<<endl;
  59.       for(int i=0;i<=c;i++)
  60.         cout<<" ";
  61.       cout<<"3"<<endl;
  62.       for(int i=0;i<=d;i++)
  63.         cout<<" ";
  64.       cout<<"4"<<endl;
  65.       for(int i=0;i<=e;i++)
  66.         cout<<" ";
  67.       cout<<"5"<<endl;
  68.       for(int i=0;i<=f;i++)
  69.         cout<<" ";
  70.       cout<<"6"<<endl;
  71.       for(int i=0;i<=g;i++)
  72.         cout<<" ";
  73.       cout<<"7"<<endl;
  74.       for(int i=0;i<=h;i++)
  75.         cout<<" ";
  76.       cout<<"8"<<endl;
  77.       system("cls");
  78.     }
  79.     cout<<"over"<<endl;
  80.     cout<<"---------------------------------------------------------|win"<<endl;
  81.     for(int i=0;i<=a;i++)
  82.       cout<<" ";
  83.     cout<<"1"<<endl;
  84.     for(int i=0;i<=b;i++)
  85.       cout<<" ";
  86.     cout<<"2"<<endl;
  87.     for(int i=0;i<=c;i++)
  88.       cout<<" ";
  89.     cout<<"3"<<endl;
  90.     for(int i=0;i<=d;i++)
  91.       cout<<" ";
  92.     cout<<"4"<<endl;
  93.     for(int i=0;i<=e;i++)
  94.       cout<<" ";
  95.     cout<<"5"<<endl;
  96.     for(int i=0;i<=f;i++)
  97.       cout<<" ";
  98.     cout<<"6"<<endl;
  99.     for(int i=0;i<=g;i++)
  100.       cout<<" ";
  101.     cout<<"7"<<endl;
  102.     for(int i=0;i<=h;i++)
  103.       cout<<" ";
  104.     cout<<"8"<<endl;
  105.     system("pause");
  106.     return 0;
  107. }
複製代碼

TOP

返回列表