fork(1) download
  1. char *month(int n);
  2.  
  3. main()
  4. {
  5. int c;
  6. system("chcp 1251");
  7. scanf("%d", &c);
  8. printf("%s", month(c));
  9. }
  10.  
  11. char *month(int n)
  12. {
  13. static char *name[] = {
  14. "Error",
  15. "Январь", "Февраль", "Март",
  16. "Апрель", "Май", "Июнь",
  17. "Июль", "Август", "Сентябрь",
  18. "Октябрь", "Ноябрь", "Декабрь"
  19. };
  20. return (n < 1 || n > 12) ? name[0] : name[n];
  21. }
Success #stdin #stdout #stderr 0s 4352KB
stdin
3
stdout
Март
stderr
sh: 1: chcp: not found