User:Shuo Xiang/Post.c


 * 1) include 

main { char input[3000]; int n = 0; FILE *f;

fgets(input, 2999, stdin); f = fopen("cs492a6.out", "a"); fprintf(f,"\n%s\n", input); fclose(f);

f = fopen("token", "r"); fscanf(f, "%d", &n); fclose(f);

f = fopen("token", "w"); fprintf(f, "%d", n+1); fclose(f);

printf("Content-type: text/html\n\n"); printf(" \n \n"); printf(" Thank you! \n", input); printf(" You have the honor of being the %d th person to respond to my survey using the dropbox! \n", n); printf(" Thank you for your participation. Your responses to the survey are much appreciated! \n"); printf(" The final essay should be posted on my user page no later than March 27. Stay tuned!!! "); printf(" \n \n"); }