#include <iostream>
#include <cstring>
using namespace std;
int main(){
string num;
int sum;
cout<<"Input number:"<<endl;
cin>>num;
sum = num[0] - '0' + num.back() - '0';
cout<<"Output number: "<< sum << endl;
return 0;
}
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
#include <iostream>
#include <cstring>
using namespace std;
int main(){
string num;
int sum;
cout<<"Input number:"<<endl;
cin>>num;
sum = num[0] - '0' + num.back() - '0';
cout<<"Output number: "<< sum << endl;
return 0;
}