使用增量的间隔的简单计数器
Simple counter with a interval using increment
所以我想做一个简单的计数器。我通过做 a = 18 开始了一个版本;和 b = 100;有了这个工作,我的墨水。现在我想让用户定义开始和结束。所以我只是做了一点cout/cin对话。我不知道为什么它不像以前那样工作。
这是我正在使用的代码:
int a; //start
a = 0;
int b; //end
b = 0;
cout << "Start eingeben: " << endl; //define start
cin >> a;
cout << "Ende eingeben: " << endl; //define end
cin >> b;
for(int a ; a <= b; a++){
cout << a << endl;
}
for(int a ; a <= b; a++){
定义一个新的a
变量,该变量隐藏了您放入值的a
。尝试:
for(; a <= b; a++)
相关文章:
- 在c++中用vector填充一个简单的动态数组
- (C++)分析树以计算返回错误值的简单算术表达式
- 我的简单if-else语句是如何无法访问的代码
- 使用简单类型列表实现的指数编译时间.为什么
- 循环在计数器中不起作用
- 如何在BST的这个简单递归实现中消除警告
- 一种在C++中读取TXT配置文件的简单方法
- 关于简单C++函数(is_palindrome)的逻辑的问题
- 显示错误输出的简单数组排序程序
- 当无法使用模板和宏时,生成类型变体C++代码的最简单方法是什么?
- python集合的C++等价物是什么.计数器
- 退出简单while循环时出现问题
- 为什么简单的算术减法在"if"条件下不起作用?
- C++-字符串是否包含一个带有简单循环的单词
- 如何在C 中实施简单的比较和交换共享计数器
- 在C++11中实现共享整数计数器而不使用互斥的最简单方法:
- 使用增量的间隔的简单计数器
- TinyThread计数器 - 便携式c++0和c++11线程间通信变得简单
- 使用迭代或简单的循环计数器,哪个更快
- 用户输入的简单c++计数器程序