Предмет: Информатика, автор: Z29

Помогите с кодом на С++

Приложения:

Ответы

Автор ответа: danulpopov
0
#include <bits/stdc++.h>

using namespace std;

int main()
{
    string s;
    cin >> s;
    string t;
    cin >> t;
    if (s[0] == '-' && t[0] == '-')swap(s,t);
    else if (s[0] == '-'){cout << 1; return 0;}
        else if (t[0]=='-'){cout << 2; return 0;}
    if (s.length() > t.length()){cout << 2; return 0;}
    if (s.length() < t.length()){cout << 1; return 0;}
    if (s > t){cout << 2; return 0;}
    if (s < t){cout << 1; return 0;}
}



Автор ответа: Z29
0
Уже не нужно
Автор ответа: danulpopov
0
ok
Похожие вопросы