I am trying to do this program-> http://wcipeg.com/problem/ccc12s1-> But can not find the problem when entering in 90

/*I am trying to do this program-> http://wcipeg.com/problem/ccc12s1 But can not find the problem when entering in 90.*\
#include <iostream>
#include <fstream>
#include <cmath>
using namespace std;

int main()
{
int goalscorer;
int combinations=0;
ifstream InSquares( "D:/q7.txt");//Before outputting the program, make a file called q7.txt, and then input 90 of tiles in it.
if (! InSquares){
cerr<<"File could not be open\n";
exit(1);}
InSquares >>goalscorer;
ofstream outSquare("D:/q7answer.txt");//This will make a file called q7answer.txt on its own, and give you the answer
int counter0,counter1,counter2,counter3;
counter0=0,counter1=1,counter2=2,counter3=3;
while(counter0<goalscorer-3){
counter0++;
while(counter1<goalscorer-2){
counter1++;
while(counter2<goalscorer-1){
counter2++;
while( counter3<goalscorer){
counter3++;

if(counter0<counter1 && counter0<counter2 && counter0<counter3 && counter1<counter2 && counter1<counter3 && counter2<counter3 && counter3<=goalscorer&&counter1>counter0&&counter2>counter1&&counter2>counter0 && counter3>counter2 && counter3>counter1 && counter3>counter0){
combinations++;

}



}
counter3=3;
}
counter2=2;
}
counter1=1;
}
outSquare<<combinations<<endl;
cout<<combinations<<endl;
return 0;
}


Last edited on
1) Please use code tags when posting code, to make it readable:

http://www.cplusplus.com/articles/z13hAqkS/

2) What problem? We can't read your mind.
Topic archived. No new replies allowed.