xxxxxxxxxx
#include <bits/stdc++.h>
using namespace std;
long int getSumOfFactors(int n)
{
long int temp = 0;
for (int i=1;i<=n;i++){
if (n%i==0) temp = temp+i;
}
return temp;
}
int main()
{
int n;
cout<<"Input the number : ";
cin>>n;
long int result = getSumOfFactors(n);
cout<<"\nThe Summation of the all the factors of the number is : "<<result;
}
xxxxxxxxxx
#include<bits/stdc++.h>
using namespace std;
int
main ()
{
string s1, s2;
cin >> s1 >> s2;
cout << s1.size () << " " << s2.size () << endl;
cout << s1 << s2 << endl;
char temp;
temp = s1[0];
s1[0] = s2[0];
s2[0] = temp;
cout << s1 << " " << s2 << endl;
}