0

How can I get a result like this

1 1 2 1 1 3 3 1 1 4 4 4 1

18th Feb 2017, 6:14 PM
GOPICHAND j
GOPICHAND j - avatar
1 Odpowiedź
+ 2
#include <iostream> using namespace std; int main() { for(int I=1;I<=4;I++) { for(int j=1;j<((I==1)?I:I+1);j++) { if(j==1) cout<<j; else cout<<I; } cout<<"1"<<endl; } return 0; }
18th Feb 2017, 8:06 PM
Megatron
Megatron - avatar