fork download
  1. /*
  2.  * File: main.cpp
  3.  * Author: piter cf16 eu
  4.  */
  5.  
  6. #include<iostream>
  7. #include <iomanip>
  8.  
  9. int main()
  10. {
  11. int count=0;
  12. int total=0;
  13.  
  14. while( count <= 10)
  15. {
  16. total += count;
  17. std::cout << "count = " << std::setw(15) <<
  18. count << "total = " << total << std::endl;
  19. count++;
  20. }
  21. }
Success #stdin #stdout 0s 3340KB
stdin
12345678
12345678


stdout
count =               0total = 0
count =               1total = 1
count =               2total = 3
count =               3total = 6
count =               4total = 10
count =               5total = 15
count =               6total = 21
count =               7total = 28
count =               8total = 36
count =               9total = 45
count =              10total = 55