fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int a , b, n;
  6. cin >> a >> b >> n;
  7. int copyN = n;
  8. while (copyN--) {
  9. if ((a % 2 == 0 && b % 2 == 0 && n % 2 == 0) && copyN >= 1) {
  10. if (copyN == n - 1) {
  11. cout << a << "<";
  12. } else {
  13. cout << b * n << ">";
  14. }
  15. } else if ((a % 2 == 0 && b % 2 == 0 && n % 2 == 0) && copyN == 0){
  16. cout << b;
  17. }else if ((a % 2 != 0 || b % 2 != 0 || n % 2 != 0)) {
  18. cout << (a + n) / 2 ;
  19. }
  20. }
  21. cout <<"\n>>" << 14 / 3;
  22. return 0;
  23. }
Success #stdin #stdout 0s 5320KB
stdin
8 2 4
stdout
8<8>8>2
>>4