add-digits 1.0.0
Add digits
Loading...
Searching...
No Matches
main.cpp
Go to the documentation of this file.
1#include <bits/stdc++.h>
2
3using namespace std;
4
6{
7public:
8 int addDigits(int num)
9 {
10 return 1 + (num - 1) % 9;
11 }
12};
13
14int main()
15{
16 cout << Solution().addDigits(12345) << endl;
17 return 0;
18}
int addDigits(int num)
Definition main.cpp:8
int main()
Definition main.cpp:14