Example #1
0
int main(){
	int count = 0;
	for(int a = 0; a <= 200; a++){
		for(int b = 0; b <= 100; b++){
			for(int c = 0; c <= 40; c++){
				for(int d = 0; d <= 20; d++){
					for(int e = 0; e <= 10; e++){
						for(int f = 0; f <= 4; f++){
							for(int g = 0; g <= 2; g++){
								for(int h = 0; h <= 1; h++){
									if(linear_combinations(a, b, c, d, e, f, g, h) == 200){
										count++;
										if(count % 100 == 0){
											printf("%d\n", count);
										}
									}
								}
							}
						}
					}
				}
			}
		}
	}
	printf("%d\n", count);
}
Example #2
0
File: linco.c Project: rforge/muste
void muste_linco(char *argv)
        {
        int i;

// RS 5.5.2014 Variable init 
// SURVO_DATA d;
A=NULL;
rlab=NULL;
clab=NULL;
rdim=cdim=lr=lc=type=0;
expr[0]=EOS;
matname[0]=EOS;
pros=0;
var=NULL;
y=NULL;
outvar=NULL;
lag=NULL;
act=0;

  //    if (argc==1) return;
        s_init(argv);

        if (g<3)
            {
            sur_print("\nUsage: LINCO <SURVO_data>,<matrix_of_coefficients>");
            WAIT; return;
            }
        i=data_open2(word[1],&d,1,0,0); if (i<0) return;
                                /* tilaa uusille muuttujille */
        i=spec_init(r1+r-1); if (i<0) return;

        pros=0;

        act='A'; i=spfind("ACT");
        if (i>=0) act=*spb[i];

        i=conditions(&d); if (i<0) return;  /* permitted only once */
        i=matparam(); if (i<0) return;
        i=matrix_load(matname,&A,&rdim,&cdim,&rlab,&clab,&lr,&lc,&type,expr);
        if (i<0) return;

        i=varaa_tilat(); if (i<0) return;
        i=find_variables();
        if (i<0)
            {
            if (etu==2)
                {
                sprintf(tut_info,"___@%d@LINCO@Error in LINCO@",-i);
                s_end(argv[1]); return;
                }
            return;
            }
        linear_combinations();
        data_close(&d);
        s_end(argv);
        }