Skip to content

Instantly share code, notes, and snippets.

@ampulhetadosaber
Created June 29, 2019 00:43
Show Gist options
  • Save ampulhetadosaber/b548c2579b2257dbd08b67ec3aa577b4 to your computer and use it in GitHub Desktop.
Save ampulhetadosaber/b548c2579b2257dbd08b67ec3aa577b4 to your computer and use it in GitHub Desktop.
#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