#31078: 簡易判斷


meavuq0a (unknown)

學校 : 不指定學校
編號 : 135984
來源 : [27.53.72.50]
最後登入時間 :
2022-10-23 12:47:23

#define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
using namespace std;

int main(void) {
    ios_base::sync_with_stdio(0);
    cin.tie(0);

    int a, b;
    while (cin >> a >> b) {
        if (a == 0 && b == 0) {
            break;
        }
        int sb = sqrt(b);
        int sa = sqrt(a);
        if (sqrt(a) - sa != 0) {
            cout << sb - sa << endl;
        }
        else {
            cout << sb - sa + 1 << endl;
        }

    }
    return 0;
}