Revision as of 20:01, 13 May 2024 by Admin (Created page with "One possible solution: <syntaxhighlight lang="C"> #include<stdio.h> int main(void) { int n; scanf("%d",&n); for(int i=0;i<n;i++) { for(int j=0;j<=i;j++) putchar(42); putchar(10); } while((n=getchar())!=10); getchar(); return 0; } </syntaxhighlight>")
Exercise
ABy Admin
May 13'24
Answer
One possible solution:
#include<stdio.h>
int main(void) {
int n;
scanf("%d",&n);
for(int i=0;i<n;i++) {
for(int j=0;j<=i;j++)
putchar(42);
putchar(10);
}
while((n=getchar())!=10);
getchar();
return 0;
}