-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.cpp
42 lines (40 loc) · 979 Bytes
/
test.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define FASTIO \
ios_base::sync_with_stdio(false); \
cin.tie(nullptr); \
cout.tie(nullptr);
#define For(start, end) for(int i = start; i < end; i++)
#define testloop int t;cin >> t;while (t--)
//// --> ... ALIASES ... -->
#define nl '\n'
#define vi vector<int>
#define vc vector<char>
#define vs vector<string>
#define vd vector<double>
#define vii vector<pair<int, int>>
#define vsi vector<pair<stirng, int>>
void solve()
{
vi num1 = {1, 2, 3, 4, 5};
vi num2 = {1, 2, 3, 4, 5};
vi res;
int smallSize = (num1.size() > num2.size()? num2.size(): num1.size());
cout << smallSize;
for (int i = 0; i < smallSize-1; i++) {
int sum = num1[i]+num2[i];
if (sum > 10) res[i+1]++;
res[i] = sum%10;
}
for (auto x: res) {
cout << x;
}
}
//---> Main <---//
int main()
{
FASTIO
solve();
return 0;
}