CSES - E4590 2016 2 - Results
Submission details
Task:ModAdd
Sender:idan
Submission time:2016-09-24 13:49:41 +0300
Language:C++
Status:READY
Result:
Test results
testverdicttime
#10.06 sdetails
#20.06 sdetails
#30.05 sdetails
#40.06 sdetails
#50.06 sdetails
#60.05 sdetails
#70.06 sdetails
#80.06 sdetails
#90.05 sdetails
#100.05 sdetails

Compiler report

input/code.cpp: In function 'int main()':
input/code.cpp:13:19: warning: format '%d' expects argument of type 'int*', but argument 2 has type 'long long unsigned int*' [-Wformat=]
  scanf("%d", &numA);
                   ^
input/code.cpp:14:19: warning: format '%d' expects argument of type 'int*', but argument 2 has type 'long long unsigned int*' [-Wformat=]
  scanf("%d", &numB);
                   ^
input/code.cpp:27:21: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long long unsigned int' [-Wformat=]
  printf("%d", result);
                     ^
input/code.cpp:13:20: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d", &numA);
                    ^
input/code.cpp:14:20: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d", &numB);
                    ^

Code

/*********************************
* Class: MAGSHIMIM C2 *
* Week 1 *
**********************************/
#include <stdio.h>
#include <math.h>
int main(void)
{
unsigned long long numA = 0, numB = 0, i = 0, result = 0, currentDigit = 0;
unsigned long long power = 1;
scanf("%d", &numA);
scanf("%d", &numB);
for (i = 0; i < 10; i++)
{
int Alsd = numA % 10;
int Blsd = numB % 10;
currentDigit = (Alsd + Blsd) % 10;
result += (currentDigit * power);
numA /= 10;
numB /= 10;
power *= 10;
}
printf("%d", result);
//system("Pause");
}

Test details

Test 1

Verdict:

input
3797629225
9766508989

correct output
2453127104

user output
568226216

Test 2

Verdict:

input
552139016901047883384892240490...

correct output
552139016901047883384892240490...

user output
717219572

Test 3

Verdict:

input
860793811134668093345482099582...

correct output
487710306894083216377653715430...

user output
-101110112

Test 4

Verdict:

input
2
870841652294197226626825161089...

correct output
870841652294197226626825161089...

user output
1

Test 5

Verdict:

input
0
404905566051213252279994991040...

correct output
404905566051213252279994991040...

user output
-1

Test 6

Verdict:

input
430112167406460960088878635088...

correct output
430112167406460960088878635088...

user output
-1

Test 7

Verdict:

input
867016005819001635643395991596...

correct output
999999999999999999999999999999...

user output
-101110112

Test 8

Verdict:

input
120453771521975552204976752778...

correct output
0

user output
-101110112

Test 9

Verdict:

input
239979749009277805816504910098...

correct output
239979749009277805816504910098...

user output
3

Test 10

Verdict:

input
990963963634143754324162574923...

correct output
818540385713473048971388312665...

user output
-101110112