#define _CRT_SECURE_NO_WARNINGS 1 #include <stdio.h> #include <windows.h> int main() { unsigned int i; for (i = 9; i >=0; i--) { printf("%u\n", i); Sleep(100); } return 0; }
死循环,因为无符号整数,没有负数
例:
#define _CRT_SECURE_NO_WARNINGS 1 #include <stdio.h> #include <windows.h> int main() { char a[1000]; int i; for (i = 0; i < 1000; i++) { a[i] = -1 - i; } printf("%d", strlen(a)); }
这里-1~-128,127~1最后到0,strlen()检测到0则停止计数
标签:SECURE,CRT,int,练习,29,整数,printf,include,strlen From: https://www.cnblogs.com/ayue6/p/17761832.html