Day14

 

 3.代码示例

#include<iostream>
using namespace std;
int main(){
    int a,b,num=0;
    cout<<"    "<<"白球"<<"     "<<"红球"<<"     "<<"黑球"<<endl;
    for(a=0;a<4;a++){
        for(b=0;b<4;b++){
            if((a+b)>=2){
                
                cout<<++num<<"    "<<a<<"         "<<b<<"       "<<8-a-b<<endl;
            }
        }
    }
    return 0;
} 

4.结果输出

 

posted @ 2023-04-27 20:18  奶油冰激凌  阅读(15)  评论(0)    收藏  举报