fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. int i, j, k, n;
  5. // 处理scanf返回值,消除警告
  6. if (scanf("%d", &n) != 1) {
  7. return 1;
  8. }
  9.  
  10. for (i = n; i >= 1; i--) {
  11. // 先打印i个hello
  12. for (j = 1; j <= i; j++) {
  13. printf("hello");
  14. }
  15. printf("\n");
  16.  
  17. // 再打印制表符
  18. for (k = 0; k <= i - 1; k++) {
  19. printf("\t");
  20. }
  21. printf("\n");
  22. }
  23.  
  24. return 0;
  25. }
  26.  
Success #stdin #stdout 0s 5320KB
stdin
6
stdout
hellohellohellohellohellohello
						
hellohellohellohellohello
					
hellohellohellohello
				
hellohellohello
			
hellohello
		
hello