Solution:
#include<iostream>
using namespace std;
int main()
{
int n,p;
cin>>n>>p;
if(n>p)
{
while(n%10!=0)
{
n++;
p--;
}
cout<<n<<" "<<p;
}
else if(p>n)
{
while(p%10!=0)
{
p++;
n--;
}
cout<<n<<" "<<p;
}
}
Solution:
#include<iostream>
using namespace std;
int main()
{
int n,p;
cin>>n>>p;
if(n>p)
{
while(n%10!=0)
{
n++;
p--;
}
cout<<n<<" "<<p;
}
else if(p>n)
{
while(p%10!=0)
{
p++;
n--;
}
cout<<n<<" "<<p;
}
}
0 comments:
Post a Comment