Submission #19723582


Source Code Expand

Copy
#include<iostream>

using namespace std;

int main()
{
  int a;
  int b;
  int s;
  int k;
  cin >> a >> b;
  for (int n = 0; n < 3; n++)
  {
    s = s + a % 10;
     a /=10;
  }
  for (int i = 0; i < 3; i++)
  {
    k = k + b %10;
    b /= 10;
  }
  if (s > k ) cout << s << endl;
  else cout << k << endl;
  return 0;
}
  
  
  

Submission Info

Submission Time
Task A - Large Digits
User runnerrunner
Language C++ (GCC 9.2.1)
Score 100
Code Size 357 Byte
Status AC
Exec Time 8 ms
Memory 3596 KB

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:14:7: warning: ‘s’ is used uninitialized in this function [-Wuninitialized]
   14 |     s = s + a % 10;
      |     ~~^~~~~~~~~~~~
./Main.cpp:19:7: warning: ‘k’ is used uninitialized in this function [-Wuninitialized]
   19 |     k = k + b %10;
      |     ~~^~~~~~~~~~~

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 100 / 100
Status
AC × 3
AC × 13
Set Name Test Cases
Sample sample_01.txt, sample_02.txt, sample_03.txt
All hand_01.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, sample_01.txt, sample_02.txt, sample_03.txt
Case Name Status Exec Time Memory
hand_01.txt AC 8 ms 3404 KB
random_01.txt AC 2 ms 3508 KB
random_02.txt AC 2 ms 3508 KB
random_03.txt AC 2 ms 3384 KB
random_04.txt AC 2 ms 3536 KB
random_05.txt AC 2 ms 3596 KB
random_06.txt AC 3 ms 3376 KB
random_07.txt AC 2 ms 3404 KB
random_08.txt AC 3 ms 3460 KB
random_09.txt AC 7 ms 3400 KB
sample_01.txt AC 2 ms 3408 KB
sample_02.txt AC 2 ms 3404 KB
sample_03.txt AC 2 ms 3408 KB