[ create a new paste ] login | about

Link: http://codepad.org/o9opZRAi    [ raw code | fork ]

iamyeasin - C++, pasted on Mar 14:
#include<bits/stdc++.h>

using namespace std;

long num[10000];
int k =0;

void n()
{
    for(int i=1; i<2000; i++)
    {
        num[k++] = i*i;
    }

//    for(int i=0; i<500; i++)
//    {
//        cout<<num[i]<<endl;
//    }
}

int main()
{
    n();
    int counter=0;
    int kase,n,a,b;

//    scanf("%d",&kase);
    while(scanf("%d %d",&a,&b),a||b)
    {
        for(int i=0; i<1000; i++)
        {
            if(num[i] >= a && num[i] <= b)
            {
                counter++;
            }
        }
        printf("%d\n",counter);
        counter = 0;
    }


    return 0;
}


Create a new paste based on this one


Comments: