eolymp
bolt
Try our new interface for solving problems
Problems

Двозначні числа 2

published at 2/22/24, 8:09:02 pm

include <bits/stdc++.h>

using namespace std; int main () {

long long m = 0, x, y;
short n;
cin>>n;
if(n==0||n==20||n==19){
    cout<<0;
    return 0;
}
for(int i = 10; i<100; i++){
    x = i/10;
    y = i%10;
    if(x+y==n&&x<y){
        m++;
    }
}
cout<<m;

} //TECHNOBLADE NEVER DIES