4 solutions
- 1
Information
- ID
- 6766
- Time
- 1000ms
- Memory
- 128MiB
- Difficulty
- 1
- Tags
- # Submissions
- 81
- Accepted
- 43
- Uploaded By
#include
using namespace std;
int main(){ char a; cin>>a; for (int i=1;i<=5;i++){ if (i%2==0){ continue; } for (int j=1;j<=(5-i)/2;j++){ cout<<" "; } for (int j=1;j<=i;j++){ cout<<a; } cout<<"\n"; } }
a=input();
for i in range(1,4):
b=' '*(3-i)
print(b,end='')
for j in range(i*2-1):
print(a,end='')
print('')
#include <iostream>
using namespace std;
int main(){
char a;
cin>>a;
for (int i=1;i<=5;i++){
if (i%2==0){
continue;
}
for (int j=1;j<=(5-i)/2;j++){
cout<<" ";
}
for (int j=1;j<=i;j++){
cout<<a;
}
cout<<"\n";
}
}
By signing up a HFOJ universal account, you can submit code and join discussions in all online judging services provided by us.