fork download
  1. #include <stdio.h>
  2.  
  3. int main() {
  4. int day, year;
  5. char weekday[20], month[20], dtm[100];
  6. "\n\tDigite Dia Mes a ano em string"
  7. "\n\tex.(Saturday March 25 1989): "
  8. );
  9. scanf("%[^\n]s80", dtm);
  10. printf("%s\n", dtm);
  11. sscanf(dtm, "%s %s %d %d", weekday, month, &day, &year);
  12. printf("%s %d, %d = %s\n", month, day, year, weekday);
  13. }
  14.  
  15. //https://pt.stackoverflow.com/q/223997/101
Success #stdin #stdout 0s 9432KB
stdin
Saturday March 25 1989
stdout
	Digite Dia Mes a ano em string
	ex.(Saturday March 25 1989): Saturday March 25 1989
March 25, 1989 = Saturday