alexjercan/bugnet huggingface dataset:
Problem p02393 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <algorithm>
#include <iostream>
int main() {
  int a[3];
  for (int i = 0; i < 3; ++i) {
    std::cin >> a[i];
  }
  std::sort(a, a + 3);
  std::cout << a[0] << " " << a[1] << " " << a[2] << std::endl;
  return 0;
}

Error: TLE

Fixed submission:

#include <algorithm>
#include <iostream>
int main() {
  int a[3];
  for (int i = 0; i < 3; ++i) {
    std::cin >> a[i];
  }
  std::sort(a, a + 3);
  for (int i = 0; i < 3; --i) {
    std::cout << a[i] << std::endl;
  }
  return 0;
}
Problem p02393 (C++) — buggy submission, verdict: Runtime Error

#include <algorithm>
#include <iostream>
using namespace std;
int main() {
  int input[3];
  cin >> input[0] >> input[1] >> input[2];
  sort(input, input + 3);
  cout << input[0] << " " << input[1] << " " << input[2] << endl;
  return 0;
}

Error: -11

Fixed submission:

#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
int main() {
  vector<int> input;
  int temp;
  int out[3];
  int i = 0;

  for (i = 0; i < 3; i++) {
    cin >> temp;
    input.push_back(temp);
  }
  sort(input.begin(), input.end());
  vector<int>::iterator it;
  while (it != input.end()) {
    out[i] = *it;
    ++it;
    ++i;
  }
  cout << out[0] << " " << out[1] << " " << out[3] << endl;
  return 0;
}
Problem p02396 (C++) — buggy submission, verdict: Runtime Error

#include "iostream"
#include "string"

int main() {
  int temp = 1;
  int Num[10240];
  int i = 0;

  while (temp != 0) {
    std::cin >> temp;
    Num[i] = temp;
    i++;
  }

  i = 0;
  while (Num[i] != 0) {
    std::cout << "Case " << i + 1 << ": " << Num[i] << std::endl;
    i++;
  }
  return 0;
}

Error: 0

Fixed submission:

#include "iostream"
#include "string"

int main() {
  int temp = 1;
  int Num[512];
  int i = 0;

  while (temp != 0) {
    std::cin >> temp;
    Num[i] = temp;
    i++;
  }

  i = 0;
  while (Num[i] != 0) {
    std::cout << "Case " << i + 1 << ": " << Num[i] << std::endl;
    i++;
  }
  return 0;
}
Problem p02396 (C++) — buggy submission, verdict: Runtime Error

#include <cstdio>
#include <iostream>
using namespace std;

int main() {
  int a[10000];
  int i = 0;
  while (1) {
    cin >> a[i];

    if (a[i] == 0) {
      break;
    }
    cout << "Case " << i + 1 << ": " << a[i] << endl;
    i++;
  }
  return 0;
}

Error: -11

Fixed submission:

#include <cstdio>
#include <iostream>
using namespace std;

int main() {
  int a[10000];
  int i = 0;
  while (1) {
    cin >> a[i];
    if (a[i] == 0) {
      break;
    }
    i++;
  }
  i--;
  for (int k = 0; k <= i; i++) {
    cout << "Case " << k + 1 << ": " << a[i] << endl;
  }
  return 0;
}
Problem p02396 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <algorithm>
#include <iostream>
#include <math.h>
#include <stdio.h>

using namespace std;

int main() {
  int i, in;
  i = 0;
  while (true) {
    i++;
    cin >> in;
    if (in == 0)
      break;
    printf("Case %d: %d\\n", i, in);
  }

  return 0;
}

Error: TLE

Fixed submission:

#include <algorithm>
#include <iostream>
#include <math.h>
#include <stdio.h>

using namespace std;

int main() {
  int i, in;
  i = 0;
  while (true) {
    i++;
    cin >> in;
    if (i == 0)
      break;
    printf("Case %d: %d\\n", i, in);
  }

  return 0;
}
Problem p02396 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;
int main() {
  long x = 1;
  for (long i = 1; x != 0; i++) {
    cin >> x;
    if (x != 0)
      cout << "Case " << i << ": " << x << '\\n';
  }
  return 0;
}


Error: TLE

Fixed submission:

#include <iostream>
using namespace std;
int main() {
  int i, x;
  i = 1;
  cin >> x;
  while (i > 0) {
    if (x = 0)
      break;
    cout << "Case " << i << ": " << x << endl;
    i = i + 1;
    cin >> x;
  }
  return 0;
}
Problem p02396 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <stdio.h>

int main(void) {
  int i, x;
  for (i = 1;; i++) {
    scanf("%5d", &x);
    if (x == 0) {
      break;
    }
    if (x > 1 && 10000 < x) {
      break;
    }
    printf("Case %d: %d\\n", i, x);
  }
}


Error: TLE

Fixed submission:

#include <stdio.h>

int main(void) {
  int i, x;
  for (i = 1;; i++) {
    scanf("%5d", &x);
    printf("Case%d;%d\\n", i, x);
  }
}
Problem p02396 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;
int main() {
  int x, y;
  y = 0;
  while (1) {
    cin >> x;
    if (x == 0)
      break;
    y = y + 1;
    cout << "Case"
         << " " << y << ":"
         << " " << x << endl;
  }
}

Error: TLE

Fixed submission:

#include <iostream>
using namespace std;
int main() {
  int x, i;
  for (i = 1; i >= 1; i += 1)
    while (1) {
      cin >> x;
      if (x == 0)
        break;
      cout << "Case"
           << " " << i << ":"
           << " " << x << endl;
      break;
      return 0;
    }
}
Problem p02396 (C++) — buggy submission, verdict: Runtime Error

#include <iostream>
#include <string>

using namespace std;

int main() {
  int array[10001];
  int i = 0;
  while (cin >> array[++i]) {
  }
  i = 0;
  while (array[++i]) {
    cout << "Case " << i << ": " << array[i] << endl;
  }
  return 0;
}


Error: 0

Fixed submission:

#include <iostream>
#include <string>

using namespace std;

int main() {
  string array[10001];
  int i = 0;
  while (cin >> array[++i], array[i] != "0") {
    cout << "Case " << i << ": " + array[i] << endl;
  }
  return 0;
}
Problem p02396 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <stdio.h>
int main() {
  int i, x, j = 1;
  while (1) {
    scanf("%d", &x);
    if (x == 0)
      break;
    printf("Case %d: %d\\n", j, x);
    j++;
  }
  return 0;
}

Error: TLE

Fixed submission:

#include <stdio.h>
int main() {
  int i, x, j = 1;
  while (1) {
    scanf("%d", &x);
    if (x = 0)
      break;
    printf("Case %d: %d", &j, &x);
    j++;
  }
  return 0;
}
Problem p02396 (C++) — buggy submission, verdict: Runtime Error

#include <bits/stdc++.h>
using namespace std;

int main() {
  vector<int> x(10001);
  int idx = 0;
  while (true) {
    cin >> x.at(idx);
    if (x.at(idx) == 0)
      break;
    idx++;
  }
  idx = 0;
  while (x.at(idx) != 0) {
    cout << "Case " << idx + 1 << ": " << x.at(idx) << endl;
    idx++;
  }
}


Error: 0

Fixed submission:

#include <bits/stdc++.h>
using namespace std;

int main() {
  vector<int> x(10000);
  int idx = 0;
  while (true) {
    cin >> x.at(idx);
    if (x.at(idx) == 0)
      break;
    idx++;
  }
  idx = 0;
  while (x.at(idx) != 0) {
    cout << "Case " << idx + 1 << ": " << x.at(idx) << endl;
    idx++;
  }
}
Problem p02396 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>

using namespace std;

int main()

{
  int x, i;

  for (i = 0;; i++) {
    cin >> x;
    if (x != 0) {
      cout << "Case " << i + 1 << ": " << x << endl;
    } else
      break;
  }
  return 0;
}


Error: TLE

Fixed submission:

#include <iostream>

using namespace std;

int main()

{
  int x, i;

  cin >> x;
  for (i = 0;; i++) {
    if (x != 0) {
      cout << "Case " << i++ << ": " << x << endl;
      continue;
    } else
      break;
  }
  return 0;
}
Problem p02396 (C++) — buggy submission, verdict: Runtime Error

#include <stdio.h>
int main(void) {
  int i = 0, x;
  scanf("%d", &x);
  while (x != 0) {
    printf("Case %d: %d\\n", i + 1, x);
    scanf("%d", &x);
    i++;
  }

  return 0;
}

Error: -11

Fixed submission:

#include <stdio.h>
int main(void) {
  int i, a[7];
  for (i = 0; i < 7; i++)
    scanf("%d", a[i]);
  for (i = 0; i < 7; i++)
    printf("Case %d: %d", i + 1, a[i]);

  return 0;
}
Problem p02396 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;
int main() {
  int n, i = 1;
  while (true) {
    cin >> n;
    if (n == 0) {
      break;
    } else {

      cout << "Case " << i << ": " << n << endl;
      i++;
    }
  }

  return 0;
}


Error: TLE

Fixed submission:

#include <iostream>
using namespace std;
int main() {
  int n, i = 1;
  cin >> n;
  while (true) {
    if (n == 0) {
      break;
    } else {

      cout << "Case " << i << ": " << n << endl;
      i++;
    }
  }

  return 0;
}
Problem p02396 (C++) — buggy submission, verdict: Runtime Error

#include <iostream>
using namespace std;
int main() {
  int i = 0;
  int x;
  int num[10000];
  for (i = 0; i < 10000; i++) {
    cin >> x;
    if (x == 0)
      break;
    num[i] = x;
  }

  for (int h = 0; h < i; h++) {
    cout << "Case " << h + 1 << ": " << num[h] << endl;
  }
  return 0;
}

Error: WA

Fixed submission:

#include <iostream>
using namespace std;
int main() {
  int x;
  int test[x];
  int y = 0;
  while (test[x]) {
    cin >> test[x];
    y += 1;
  }
  x = y;
  for (int i = 0; i <= x - 1; i++) {
    cout << "Case " << i + 1 << ": " << test[i] << endl;
  }
  return 0;
}
Problem p02396 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;
int main() {
  int x, i;
  i = 0;
  while (1) {
    cin >> x;
    if (x == 0)
      break;
    i++;
    cout << "Case"
         << " " << i << ":"
         << " " << x << endl;
  }
}

Error: TLE

Fixed submission:

#include <iostream>
using namespace std;
int main() {
  int x, i;
  while (1) {
    cin >> x;
    if (x == 0)
      break;
    for (i = 1; i >= 0; i++) {
      cout << "Case"
           << " " << i << ":"
           << " " << x << endl;
    }
  }
}
Problem p02396 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>

using namespace std;

int main() {
  int i = 0;
  int x;

  while (1) {
    cin >> x;
    if (x == 0)
      break;
    i++;
    cout << "Case " << i << ": " << x << endl;
  }

  //	while(1);

  return 0;
}

Error: TLE

Fixed submission:

#include <iostream>

using namespace std;

int main() {
  int i = 0;
  int x;

  while (1) {
    cin >> x;
    if (x == 0)
      break;
    i++;
    cout << "case " << i << ": " << x << endl;
  }

  while (1)
    ;

  return 0;
}
Problem p02396 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;
int main() {
  int i = 1, x;
  cin >> x;
  while (x != 0) {
    cout << "Case"
         << " " << i++ << ":"
         << " " << x << endl;
    cin >> x;
  }
  return 0;
}


Error: TLE

Fixed submission:

#include <iostream>
using namespace std;
int main() {
  int i = 1, x;
  cin >> x;
  while (x != 0) {
    cout << "Case " << i << ": " << x << endl;
    i++;
  }
  return 0;
}
Problem p02396 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;
int main() {
  int x, cnt = 0;
  while (1) {
    cin >> x;
    if (x == 0) {
      return 0;
    }
    cnt++;
    cout << "Case"
         << " " << cnt << ": " << x << endl;
  }
}


Error: TLE

Fixed submission:

#include <iostream>
using namespace std;
int main() {
  int x, cnt = 0;
  while (1) {
    cin >> x;
    if (x = 0) {
      return 0;
    }
    cnt++;
    cout << "Case"
         << " " << cnt << ": " << x << endl;
  }
}
Problem p02396 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;
int main() {
  int n;

  for (int i = 1;; i++) {

    cin >> n;
    if (n == 0) {
      break;
    }
    cout << "Case " << i << ": " << n << endl;
  }

  return 0;
}


Error: TLE

Fixed submission:

#include <iostream>
using namespace std;
int main() {
  int n;
  cin >> n;
  for (int i = 0; i = 1; i++) {
    cout << "Case " << i << ": " << n << endl;
    if (n == 0) {
      break;
    }
  }
  cout << endl;
  return 0;
}
Problem p02396 (C++) — buggy submission, verdict: Runtime Error

#include <iostream>
using namespace std;
int main(int argc, const char *argv[]) {
  int a[10005];
  int i, j;
  i = 0;
  a[0] = 1;
  while (a[i] != 0) {
    i += 1;
    cin >> a[i];
  }
  for (j = 1; j < i; j++) {
    cout << "Case " << j << ": " << a[j] << endl;
  }
  return 0;
}

Error: WA

Fixed submission:

#include <iostream>
using namespace std;
int main(int argc, const char *argv[]) {
  int a[10];
  int i, j;
  i = 0;
  a[0] = 1;
  while (a[i] != 0) {
    i += 1;
    cin >> a[i];
  }
  for (j = 1; j < i; j++) {
    cout << "Case " << j << ": " << a[j] << endl;
    cout << " " << endl;
  }
  return 0;
}
Problem p02396 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;
int main() {
  int x, i;
  cin >> x;
  i = 1;
  while (x > 0) {
    cout << "Case"
         << " " << i << ":"
         << " " << x << endl;

    i = i + 1;
    cin >> x;
  }

  return 0;
}


Error: TLE

Fixed submission:

#include <iostream>
using namespace std;
int main() {
  int x;
  cin >> x;
  while (x > 0) {
    cout << "Case"
         << ":" << x << endl;
  }

  return 0;
}
Problem p02396 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;

int main() {
  for (int x, i = 1;; i++) {
    cin >> x;
    if (x == 0)
      break;
    cout << "Case " << i << ": " << x << endl;
  }

  return 0;
}

Error: TLE

Fixed submission:

#include <iostream>
using namespace std;

int main() {
  int x, i;
  int n = 10000000;
  cin >> x;
  for (i = 0; i <= n; i++) {
    cout << "Case " << i << ": " << x << endl;
    if (x == 0) {
      break;
    }
  }
  return 0;
}
Problem p02396 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;

int main() {
  int x;
  int i = 1;
  while (1) {
    cin >> x;

    if (x == 0)
      break;

    cout << "Case " << i << ": " << x << endl;

    i++;
  }
  return 0;
}

Error: TLE

Fixed submission:

#include <iostream>
using namespace std;

int main() {
  int x;
  int i = 1;
  while (1) {
    while (1) {
      cin >> x;
      if (x >= 0 && x <= 10000)
        break;
    }

    if (x == 0 && i <= 10000)
      break;

    cout << "Case " << i << ": " << x << endl;

    i++;
  }
  return 0;
}
Problem p02396 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>

int main() {
  int i = 1, x = 0;
  std::cin >> x;

  while (x != 0) {
    std::cout << "Case " << i << ": " << x << std::endl;
    std::cin >> x;
    i++;
  }

  return 0;
}

Error: TLE

Fixed submission:

#include <iostream>

int main() {
  int i, x;
  std::cin >> i >> x;

  for (i = 1; x != 0; i++) {
    std::cout << "Case " << i << ": " << x << std::endl;
  }

  return 0;
}
Problem p02396 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;

int main() {
  for (int x, t = 1;; t++) {
    cin >> x;
    if (x == 0)
      break;
    cout << "Case " << t << ": " << x << endl;
  }

  return 0;
}

Error: TLE

Fixed submission:

#include <iostream>
using namespace std;

int main() {
  for (int x, t = 1;; t++) {
    cin >> x;
    if (x = 0)
      break;
    cout << "case" << t << ":" << x << endl;
  }
  return 0;
}
Problem p02396 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <cmath>
#include <stdio.h>
// using namespace std;
// scanf("%d%d%d%d%d",&W,&H,&x,&y,&r);
// printf("Yes\\n");
int main() {
  int a;
  int i = 1;
  while (1) {

    scanf("%d", &a);
    if (a == 0)
      break;
    if (a != 0) {
      printf("Case %d: %d\\n", i, a);
      i = i + 1;
    }
  }

  return 0;
}


Error: TLE

Fixed submission:

#include <cmath>
#include <stdio.h>
// using namespace std;
// scanf("%d%d%d%d%d",&W,&H,&x,&y,&r);
// printf("Yes\\n");
int main() {
  int a;
  int i = 1;
  while (1) {
    scanf("%d", &a);
    if (a != 0) {
      printf("Case %d: %d\\n", i, a);
      i = i + 1;
    }
  }

  return 0;
}
Problem p02396 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <stdio.h>

int main(void) {
  static int i = 0;
  int n;

  while (1) {
    scanf("%d", &n);
    if (n == 0) {
      break;
    } else {
      i++;
      printf("Case %d: %d\\n", i, n);
    }
  }

  return 0;
}

Error: TLE

Fixed submission:

#include <stdio.h>

int main(void) {
  int i = 0, x;
  while (1) {
    ++i;
    scanf("%x", &x);
    printf("Case %d: %d\\n", i, x);
  }
  return 0;
}
Problem p02396 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;

int main() {
  for (int x, t = 1;; ++t) {
    cin >> x;
    if (x == 0)
      break;
    cout << "Case " << t << ": " << x << endl;
  }
  return 0;
}

Error: TLE

Fixed submission:


#include <iostream>
using namespace std;

int main() {
  int a;
  cin >> a;
  for (int i = 1;; ++i) {
    if (a = 0)
      break;
    cout << "Case " << i << ": " << a << endl;
  }
}
Problem p02396 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;

int main() {
  for (int a, i = 1;; ++i) {
    cin >> a;
    if (a == 0)
      break;
    cout << "Case " << i << ": " << a << endl;
  }
}

Error: TLE

Fixed submission:

#include <iostream>
using namespace std;

int main() {
  int a;
  cin >> a;
  for (int i = 1;; ++i) {
    if (a == 0)
      break;
    cout << "Case " << i << ": " << a;
  }
}
Problem p02396 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;
int main() {
  int i = 0;
  int x;
  while (1) {
    cin >> x;
    if (x == 0)
      break;
    i++;
    cout << "Case"
         << " " << i << ":"
         << " " << x << endl;
  }
  return 0;
}


Error: TLE

Fixed submission:

#include <iostream>
using namespace std;
int main() {
  int i = 1;
  int x;
  cin >> x;
  while (x != 0) {
    i++;
    cout << "Case"
         << " " << i << endl;
  }
  return 0;
}
Problem p02396 (C++) — buggy submission, verdict: Runtime Error

#include <iostream>
using namespace std;

int main() {
  int x;
  for (int i = 1;; i++) {
    cin >> x;
    if (x == 0)
      break;
    cout << "Case " << i << ": " << x << endl;
  }
  return 0;
}

Error: WA

Fixed submission:

#include <iostream>
using namespace std;

int main() {
  int x[1000];
  x[0] = 1;
  for (int i = 1; x[i - 1] != 0; i++) {
    cin >> x[i];
    cout << "Case " << i << ": " << x[i] << endl;
  }
  return 0;
}
Problem p02396 (C++) — buggy submission, verdict: Runtime Error

/*
????????????????????£????????§?????????????????????????????°??????????????°?????\\????????????????????????????????????
??£????????????????????£???????????????????????????????????????
???????????\\????????????????????????????????°??????????????????????????????????????????????????????????????????
?????????????????????????????????????????????????????????????????????????????´???????????§??????

???????????´??° x
???????????????????????????????????????????????????????????°?????????????????????????????????

?????????????????????????????\\?????????????????????????????????????????????????????????????????????????????¨?????¨?????????????????????
*/

#include <iostream>
int main() {
  int num;
  int i = 1;

  while (1) {
    std::cin >> num;
    if (num == 0) {
      break;
    } else {
      std::cout << "Case " << i << ": " << num << std::endl;
      i++;
    }
  }

  return 0;
}

Error: 255
??±???


Fixed submission:

/*
????????????????????£????????§?????????????????????????????°??????????????°?????\\????????????????????????????????????
??£????????????????????£???????????????????????????????????????
???????????\\????????????????????????????????°??????????????????????????????????????????????????????????????????
?????????????????????????????????????????????????????????????????????????????´???????????§??????

???????????´??° x
???????????????????????????????????????????????????????????°?????????????????????????????????

?????????????????????????????\\?????????????????????????????????????????????????????????????????????????????¨?????¨?????????????????????
*/

#include <fstream>
#include <iostream>
#include <string>
int main() {
  int num;
  int i = 0;

  std::ifstream ifs("in1.txt");
  std::string str;
  if (ifs.fail()) {
    std::cerr << "??±???" << std::endl;
    return -1;
  }

  while (getline(ifs, str)) {
    // std::cin >> num;
    if (str != "0") {
      std::cout << "Case " << i << ":" << str << std::endl;
      i++;
    } else {
      break;
    }
  }

  return 0;
}
Problem p02396 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <algorithm>
#include <iostream>
using namespace std;

int main() {
  int suuji;
  int i = 1;
  while (true) {
    cin >> suuji;
    if (suuji == 0)
      break;
    cout << "Case " << i << ": " << suuji << endl;
    i++;
  }
  return 0;
}

Error: TLE

Fixed submission:

#include <algorithm>
#include <iostream>
using namespace std;

int main() {
  int suuji;
  int i = 1;
  while (true) {
    cin >> suuji;
    if (suuji != 0) {
      cout << "Case " << i << ": " << suuji;
    }
    i++;
  }
  return 0;
}
Problem p02396 (C++) — buggy submission, verdict: Runtime Error

#include <iostream>
using namespace std;

int main() {
  int x[25565];
  x[0] = 1;
  int i = 1;
  while (x[i - 1] != 0) {
    cin >> x[i];
    i++;
  }
  i = 1;
  while (x[i] != 0) {
    cout << "Case " << i << ": " << x[i] << endl;
    i++;
  }
}

Error: 0

Fixed submission:

#include <iostream>
using namespace std;

int main() {
  int x[100] = {1};
  int i = 0;
  for (i = 0; i < 100; i++) {
    x[i] = 1;
  }
  i = 1;
  while (x[i - 1] != 0) {
    cin >> x[i];
    i++;
  }
  i = 1;
  while (x[i] != 0) {
    cout << "Case " << i << ": " << x[i] << endl;
    i++;
  }
}
Problem p02396 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;
int main() {
  int x, i = 1;
  cin >> x;
  while (true) {
    cout << "Case"
         << " " << i << ":"
         << " " << x << endl;
    i = i + 1;
    cin >> x;
    if (x == 0)
      break;
  }
}


Error: TLE

Fixed submission:

#include <iostream>
using namespace std;
int main() {
  int x, i = 1;
  cin >> x;
  while (true) {
    cout << "Case"
         << " " << i << ":"
         << " " << x << endl;
    i = i + 1;
    if (x == 0)
      break;
  }
}
Problem p02396 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;

int main() {

  int x, i;
  while (true) {
    i++;
    cin >> x;

    if (x == 0)
      break;

    cout << "Case " << i << ": " << x << "\\n";
  }
}

Error: TLE

Fixed submission:

#include <iostream>
using namespace std;

int main() {

  int x, i;
  while (true) {
    i++;
    cin >> x;

    if (x = 0)
      break;

    cout << "Case " << i << ": " << x << "\\n";
  }
}
Problem p02396 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
#include <stdio.h>
using namespace std;

int main() {
  int i, x;

  for (i = 1;; i++) {
    cin >> x;
    if (x == 0)
      break;
    cout << "Case " << i << ": " << x << endl;
  }

  return 0;
}

Error: TLE

Fixed submission:

#include <iostream>
#include <stdio.h>
using namespace std;

int main() {
  int i, x;

  for (i = 1;; i++) {
    cin >> x;
    if (x = 0)
      break;
    cout << "Case " << i << ": " << x << endl;
  }

  return 0;
}
Problem p02396 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;

int main() {
  int x, i = 1;
  while (true) {
    cin >> x;
    if (x == 0)
      break;
    cout << "Case " << i << ": " << x << endl;
    i++;
  }
}

Error: TLE

Fixed submission:

#include <iostream>
using namespace std;

int main() {
  int x, i = 1;
  cin >> x;
  while (true) {
    if (x == 0)
      break;
    cout << "Case " << i << ": " << x << endl;
    i++;
  }
}
Problem p02396 (C++) — buggy submission, verdict: Runtime Error

// Copyright 2015 KanatoNagayama
#include <iostream>
#include <vector>
using std ::cin;
using std ::cout;
using std ::endl;
using std ::vector;
int main() {
  vector<int> v(10000);
  int i = 0;
  while (true) {
    cin >> v[i];
    if (v[i] == 0)
      break;
    i++;
  }
  for (int k = 0; k < i; k++) {
    cout << "Case " << k + 1 << ": " << v[k] << endl;
  }
  return 0;
}

Error: 0

Fixed submission:

// Copyright 2015 KanatoNagayama
#include <iostream>
#include <vector>
using std ::cin;
using std ::cout;
using std ::endl;
using std ::vector;
int main() {
  vector<int> v(1);
  int i = 0;
  while (true) {
    cin >> v[i];
    if (v[i] == 0)
      break;
    i++;
  }
  for (int k = 0; k < i; k++) {
    cout << "Case " << k + 1 << ": " << v[k] << endl;
  }
  return 0;
}