Advertisement
Courbe_Impliquee

31

Mar 21st, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. #include "stdafx.h"
  2. #include <iostream>
  3. using namespace std;
  4. int main()
  5. {
  6. int a, k = 0, l = 0;
  7. do {
  8. cin >> a;
  9. if (a == 31) {
  10. l++;
  11. if (k < l)
  12. k = l;
  13. }
  14. else
  15. l = 0;
  16. } while (a != 0);
  17. cout << "Answer: " << k;
  18. system("pause");
  19. return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement