Пример #1
0
int main()
{   void printstar();
    void print_message();
    printstar();
    print_message();
    printstar();
    return 0;
}
Пример #2
0
int main()
{
    int k;
    printf("qing shuru ni yao xianshi de xingxing shuliang: ");
    scanf("%d", &k);
    printstar(k);
    multiply99();
    printstar(k);
    system("pause");
    return 0;
}
Пример #3
0
/*Precondition: I wanted the program to not be completely unsightly
*Postcondition: Literally calls every function and prints the program to the c file
*/
void printprogram(FILE *ofp, const char * programname, char * first, char * last, int numfunct){
	fprintf(ofp, "/*\n");   printstar(1, ofp);  fprintf(ofp, "*\t%s", programname);
    printstar(5, ofp);  fprintf(ofp, "*\t%s %s (%s)", first, last, __DATE__);
    printstar(1, ofp);  fprintf(ofp, "*/\n"); linespace(ofp);
    fprintf(ofp, "/*  Pre-processor Directives    */\n");
    fprintf(ofp, "/*included libraries*/\n");   fprintf(ofp, "\t%cinclude %cstdlib.h%c\n", 35, 60, 62);
    fprintf(ofp, "\t%cinclude %cstdio.h%c\n", 35, 60, 62);  newline(1,ofp);	fprintf(ofp, "/*included constants*/\n");
    fprintf(ofp, "/*included functions*/\n");	declarefunc(ofp, numfunct);		fprintf(ofp, "/*included external variables*/\n");
	fprintf(ofp, "/*included structures*/\n"); linespace(ofp);
    fprintf(ofp, "/*main function: describe the main function here*/\n");
    fprintf(ofp, "int main%c%c %c\n", 40,41,123);   fprintf(ofp, "\t/*initialize variables, files, and pointers below*/\n\n\n\n");
    fprintf(ofp, "\treturn 0%c\n", 59); fprintf(ofp, "%c", 125);    newline(1,ofp);	definefunc(ofp, numfunct);
}
Пример #4
0
int main()
{
    int i, j, k, total;
    printf("qing shuru nin yao duoshao ge xingxing: ");
    scanf("%d", &k);
    printstar(k);
    printf("qing shuru i de zhi: ");
    scanf("%d", &i);
    printf("qing shuru j de zhi: ");
    scanf("%d", &j);
    total = sum(i, j);
    printf("zong he wei: %d\n", total);
    printstar(k);
    system("pause");
    return 0;
}
Пример #5
0
int main(int argc, char ** argv[])
{
	if(3 != argc){
		printf("Usage:hello word1 word2 \n");
	}
	
	printf("word1 is %s, word2 is %s\n",argv[0],argv[1]);
	printstar();
	
	return 0;
}