Skip to content

Commit b6e4e24

Browse files
authored
Merge pull request kothariji#51 from anupam-kumar-krishnan/patch-1
Create (CODECHEF)Sum of First and Last Digit
2 parents ea0eab4 + f1ba1f7 commit b6e4e24

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#include <iostream>
2+
#include<string.h>
3+
using namespace std;
4+
5+
int main()
6+
{
7+
int t;
8+
cin>>t;
9+
char n[10];
10+
while(t--)
11+
{
12+
cin>>n;
13+
cout<<(n[0]-'0' + n[strlen(n)-1] - '0')<<"\n";
14+
}
15+
16+
return 0;
17+
}

0 commit comments

Comments
 (0)