mirror of
https://github.com/wczffl-503/OI-Codes.git
synced 2025-07-08 02:13:51 +08:00
归类了 OJ,整理了一下
This commit is contained in:
24
XSM OJ 重庆小码王集团OJ/小码君的数字三角形.cpp
Normal file
24
XSM OJ 重庆小码王集团OJ/小码君的数字三角形.cpp
Normal file
@ -0,0 +1,24 @@
|
||||
#include <iostream>
|
||||
#include <iomanip>
|
||||
using namespace std;
|
||||
int main(){
|
||||
int a,b=1,c=1;
|
||||
cin >>a;
|
||||
for(int i=a;i>=1;i--){
|
||||
for(int j=i;j>1;j--){
|
||||
cout <<" ";
|
||||
}
|
||||
for(int k=0;k<b*2-1;k++){
|
||||
cout <<c;
|
||||
c++;
|
||||
if(c>=10){
|
||||
c=0;
|
||||
}
|
||||
}
|
||||
cout <<endl;
|
||||
b++;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user