敲代码时的一些经常使用技巧

说明:本文总结的经常使用技巧不包含编译器使用的技巧。code 1.scanf做为循环条件 因为scanf没法读入时返回EOF(-1),而-1按位取反便是0,所以有以下两种写法字符串 写法一:编译器 int main() { int n; while (scanf("%d", &n)!=EOF) { //主程序 } } 写法二:编译   int main() { int n; whi
相关文章
相关标签/搜索