1 #include <stdio.h> 2 3 void main(){ 4 int sum = 0; 5 int i = 0; 6 for(i = 0; i < 10; i++){ 7 sum += i; 8 printf("\ni = %d", i); 9 printf("\nsum = %d", sum); 10 } 11 printf("\n退出循环"); 12 }
1 #include <stdio.h> 2 3 void main(){ 4 int arr[] = {1,2,3,4,5}; 5 int i = 0; 6 int len = sizeof(arr) / sizeof(int); 7 for(i = 0; i <= len; i++){ 8 printf("\narr[%d] = %d", i, arr[i]); 9 } 10 }
标签:10,arr,int,sum,案例,应用,printf,断点 From: https://www.cnblogs.com/MorningMaple/p/16773485.html