Ejemplo n.º 1
0
int main() {
    
    // Test Example for functions
    int x = problem2(-4, 3);
    int x2 = problem3(0x12345678, 2, 0xaa);
    
    printf("A2) x = %d  \nA3) x2 = 0x%x \n",x,x2);
    
}
Ejemplo n.º 2
0
void main(void) {
	//int A[] = [ 1, 4, 3, 3, 1, 2]; // 4
	//int A[] = [6, 4, 4, 6]; // -1
	//problem1();

	int A[] = {1, 3, 2, 5, 4, 4, 6, 3, 2};
	problem3(A, 9);

}
//Begin Execution
int main(int argv,char *argc[]){
    int inN;
    do{
        Menu();
        inN=getN();
        switch(inN){
        case 1:    problem1();break;
        case 2:    problem2();break;
        case 3:    problem3();break;
        case 4:    problem4();break;
        case 5:    problem5();break;
        case 6:    problem6();break;
        default:   def(inN);}
    }while(inN>=1&&inN<=6);
    return 0;
}
Ejemplo n.º 4
0
/* The main function, or the "entry function" of the lab2 program, simply calls the other
 * functions to run.
 */
int main() {
    cout << ">> I'm going to run the lab review now:" << endl;
    illegalStatements();

    cout << ">> I'm going to run lab problem 1 now:" << endl;
    problem1();

    cout << ">> I'm going to run lab problem 2 now:" << endl;
    problem2();

    cout << ">> I'm going to run lab problem 3 now:" << endl;
    problem3();

    cout << ">> I'm going to run lab problem 4/5 now:" << endl;
    problem45();

    return 0; // Lets the operating system know everything ran successfully.
}
Ejemplo n.º 5
0
int main(void)
{
	assert(problem3(13195) == 29);

	std::cout << problem3(600851475143LL) << std::endl;
}
Ejemplo n.º 6
0
int main()
{
    problem3();
    printf("\n");
    return 0;
}