返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     int a,b;
  7.     cout<<"請輸入兩個數"<<endl;
  8.     cin>>a;
  9.     cin>>b;
  10.     if(a+b>100)
  11.     {
  12.         cout<<">100"<<endl;
  13.     }
  14.     else
  15.     {
  16.         cout<<"<100"<<endl;
  17.     }
  18.     return 0;
  19. }
複製代碼

TOP

  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     int a=0;
  7.     for(int i=0;i<10;i++)
  8.     {
  9.         if(i%2==0)
  10.         {
  11.             cout<<"ohhhhhhhhh math"<<endl;
  12.         }
  13.         else
  14.         {
  15.             cout<<"積數"<<endl;
  16.         }
  17.     }
  18. }
複製代碼

TOP

  1. #include<iostream>
  2. #include<cstdlib>
  3. #include<ctime>
  4. using namespace std;
  5. int main()
  6. {
  7.       int a[]={0,0,0,0};
  8.     srand(time(NULL));
  9.     a[rand()%4]=1;
  10.     for(int i=0;i<4;i+=1)
  11.     {
  12.         cout<<a[i];
  13.     }
  14. }
複製代碼

TOP

返回列表