... HAVE U TRIED .... AT LEAST 3 TIMES ... OK U CAN SEE THIS ...

Friday, January 24, 2014

SPOJ-13208. In Love with Loops

//Problem link>>http://www.spoj.com/problems/KIDZEE1I/

#include <iostream>
using namespace std ;
int main ()
{
    int t , i  , j , k ,cas=1;
    cin>>t ;
    while (cas<=t)
    {
        int x ,y , z ;
        cin>>x>>y>>z ;

        cout<<"Case "<<cas++<<":"<<endl ;


        for (i=0 ; i<=x ;i++)
        {
            for (j=i+1 ; j<=y ; j++)
            {
                for (k=j+1 ; k<=z ; k++)
                {
                    cout<<i<<" "<<j<<" "<<k<<endl ;
                }
            }
        }
    }

    return 0;
}

No comments:

Post a Comment