4 solutions
- 1
Information
- ID
- 6766
- Time
- 1000ms
- Memory
- 128MiB
- Difficulty
- 1
- Tags
- # Submissions
- 87
- Accepted
- 47
- Uploaded By
 BC20260080
      
                      LV 9
                    
 @ 2024-4-3 22:23:16
    
          BC20260080
      
                      LV 9
                    
 @ 2024-4-3 22:23:16
        #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"; } }
 BC20260080
      
                      LV 9
                    
 @ 2024-4-3 22:16:42
    
          BC20260080
      
                      LV 9
                    
 @ 2024-4-3 22:16:42
        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('')
 BC20260056
      
                      LV 5
                    
 @ 2024-3-18 12:13:58
    
          BC20260056
      
                      LV 5
                    
 @ 2024-3-18 12:13:58
        #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.