Created
June 29, 2019 00:43
-
-
Save ampulhetadosaber/b548c2579b2257dbd08b67ec3aa577b4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
using namespace std; | |
int Soma(int a, int b){ | |
return a + b; | |
} | |
string inverso(int x){ | |
string retorno; | |
while(x!=0){ | |
int digito = x%10; | |
retorno += digito+'0'; | |
x/=10; | |
} | |
return retorno; | |
} | |
int main(){ | |
int x, y; | |
scanf("%d%d", &x, &y); | |
printf("%s\n", inverso(Soma(x, y)).c_str()); // note que utilizamos o retorno de uma função como parâmetro de outra função | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment