Răspuns :
#include <iostream>
using namespace std;
int main()
{
long long n;
long long s;
cin>>n;
long long par = n/2;
long long impar=0;
if(n%2 == 0)
{
impar = (n/2);
}
else
{
impar = n/2+1;
}
long long zece = n/10;
long long cinci = (n/5)-zece;
s = ((impar - cinci*1)%10 + ((par-zece)*6)%10+ (cinci*5)%10)%10;
cout<<s;
}
using namespace std;
int main()
{
long long n;
long long s;
cin>>n;
long long par = n/2;
long long impar=0;
if(n%2 == 0)
{
impar = (n/2);
}
else
{
impar = n/2+1;
}
long long zece = n/10;
long long cinci = (n/5)-zece;
s = ((impar - cinci*1)%10 + ((par-zece)*6)%10+ (cinci*5)%10)%10;
cout<<s;
}
#include <iostream>
using namespace std;
int n;
int main()
{
cin >> n;
int c=n/10;
int r=n%10;
switch(r)
{
case 0 : cout << ((c*3)%10)%10; break;
case 1 : cout << ((c*3)%10+1)%10; break;
case 2 : cout << ((c*3)%10+7)%10; break;
case 3 : cout << ((c*3)%10+8)%10; break;
case 4 : cout << ((c*3)%10+14)%10; break;
case 5 : cout << ((c*3)%10+19)%10; break;
case 6 : cout << ((c*3)%10+25)%10; break;
case 7 : cout << ((c*3)%10+26)%10; break;
case 8 : cout << ((c*3)%10+32)%10; break;
case 9 : cout << ((c*3)%10+33)%10; break;
}
return 0;
}
using namespace std;
int n;
int main()
{
cin >> n;
int c=n/10;
int r=n%10;
switch(r)
{
case 0 : cout << ((c*3)%10)%10; break;
case 1 : cout << ((c*3)%10+1)%10; break;
case 2 : cout << ((c*3)%10+7)%10; break;
case 3 : cout << ((c*3)%10+8)%10; break;
case 4 : cout << ((c*3)%10+14)%10; break;
case 5 : cout << ((c*3)%10+19)%10; break;
case 6 : cout << ((c*3)%10+25)%10; break;
case 7 : cout << ((c*3)%10+26)%10; break;
case 8 : cout << ((c*3)%10+32)%10; break;
case 9 : cout << ((c*3)%10+33)%10; break;
}
return 0;
}