+ 9

why d'not work this code that was heart

include <iostream.h> int main() { int i,j; int n=5; for(i=n/2;i<=n;i+=2) { for(j=1;j<n-i;j+=2) { cout<<" "; } for(j=1;j<=i;j++) { cout<<"*"; } for(j=1;j<=n-i;j++) { cout<<" "; } for(j=1;j<=i;j++) { cout<<"*"; } cout<<endl; } /*lower part */ for(i=n;i>=1;i--) { for(j=i;j<n;j++) { cout<<" "; } for(i=1;j<=(i*2)-1;j++) { cout<<"*"; } cout<<endl; } }

15th Nov 2020, 12:15 PM
Melekte Petros
Melekte Petros - avatar
9 ответов
+ 6
Sorry for that 10Ks
15th Nov 2020, 4:00 PM
Melekte Petros
Melekte Petros - avatar
+ 6
ya
15th Nov 2020, 4:36 PM
Melekte Petros
Melekte Petros - avatar
+ 5
this was my code?
15th Nov 2020, 2:57 PM
Melekte Petros
Melekte Petros - avatar
+ 5
Whar is the lower part
15th Nov 2020, 3:52 PM
Melekte Petros
Melekte Petros - avatar
+ 5
Pls test it
15th Nov 2020, 3:56 PM
Melekte Petros
Melekte Petros - avatar