#21149: C++ TLE求救


bensonyou (sui)


#include <iostream>

using namespace std;

int main() {

    int t, a, b, sum = 0, c = 1;

    while(cin >> t){

        while(t > 0){

            cin >> a >> b;

            while(b >= a){

                if(b % 2 == 1){

                    sum += b;

                }

                b--;

            }

            cout << "case " << c << ": " << sum <<endl;

            sum = 0;

 

        }

    }

}

拜託各位了,感謝。

#22467: Re:C++ TLE求救


h911018@nehs.hc.edu.tw (PikaQqQq)


沒有return?