fork download
  1. /*
  2.  * File: main.c
  3.  * Author: DEBASIS TALDI
  4.  */
  5.  
  6. #define _CRT_SECURE_NO_WARNINGS
  7.  
  8. #include <stdio.h>
  9. #include <stdlib.h>
  10.  
  11.  
  12. #define MAX_LENGTH 100
  13.  
  14. /*
  15.  * Programming Assignment 1
  16.  */
  17. int main(int argc, char** argv)
  18. {
  19. // IMPORTANT: Only add code in the section
  20. // indicated below. The code I've provided
  21. // makes your solution work with the
  22. // automated grader on Coursera
  23. char input[MAX_LENGTH 100];
  24. fgets(input, MAX_LENGTH 100, stdin);
  25. while (input[0] != 'q')
  26. {
  27. // Add your code between this comment
  28. // and the comment below. You can of
  29. // course add more space between the
  30. // comments as needed
  31. //print message
  32. printf("H/nHe/nLi/nBe/nB/nC/nN/nO/nF/nNe/n");
  33.  
  34.  
  35. // Don't add or modify any code below
  36. // this comment except as indicated below
  37. fgets(input, MAX_LENGTH 100, stdin);
  38. }
  39.  
  40. return 0;
  41. }
Success #stdin #stdout 0.03s 25808KB
stdin
Standard input is empty
stdout
/*
 * File:   main.c
 * Author: DEBASIS TALDI
 */

#define _CRT_SECURE_NO_WARNINGS
 
#include <stdio.h>
#include <stdlib.h>


#define MAX_LENGTH 100

/*
 * Programming Assignment 1
 */
int main(int argc, char** argv)
{
	// IMPORTANT: Only add code in the section
	// indicated below. The code I've provided
	// makes your solution work with the 
	// automated grader on Coursera
	char input[MAX_LENGTH 100];
	fgets(input, MAX_LENGTH 100, stdin);
	while (input[0] != 'q')
	{		
		// Add your code between this comment
		// and the comment below. You can of
		// course add more space between the
		// comments as needed
		//print message
		printf("H/nHe/nLi/nBe/nB/nC/nN/nO/nF/nNe/n");


		// Don't add or modify any code below
		// this comment except as indicated below
		fgets(input, MAX_LENGTH 100, stdin);
	}

	return 0;
}