0

Challenge predict the output

#include <iostream> using namespace std; int main() { int n=6; int s=n; for(int i=1;i<=n;i++,s--) { for(int k=1;k<=s;k++) cout<<k; int y=s; while(y<n){ cout<<"A"; y++;} if(i<3) for(int h=n-1;h>=1;h--){ cout<<h; } if(i>=3){ int h2=n-1; for(int u=2;u<i;u++){ cout<<"A"; h2--;} for(int x=h2;h2>=1;h2--){ cout<<h2; }} cout<<endl; } }

5th Jan 2018, 4:46 PM
Arun
1 Odpowiedź
+ 1
12345654321 12345A54321 1234AAA4321 123AAAAA321 12AAAAAAA21 1AAAAAAAAA1
5th Jan 2018, 8:48 PM
Rashed Latif
Rashed Latif - avatar