• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

oga's tools


Commit MetaInfo

Révision53274d33323923d3d56272164cf0374ad7f875c5 (tree)
l'heure2023-09-23 13:08:15
Auteurhyperoga <hyperoga@gmai...>
Commiterhyperoga

Message de Log

2023/05/03 V1.01 support reiwa

Change Summary

Modification

--- a/age.c
+++ b/age.c
@@ -1,6 +1,7 @@
11 /*
22 * 和暦を西暦に変換
33 * 本日時点での年齢表示
4+ * 2023/05/03 V1.01 support reiwa
45 */
56 #include <stdio.h>
67 #include <string.h>
@@ -12,13 +13,13 @@
1213 #endif
1314
1415
15-char *gengou[] = { "西暦" , "明治", "大正", "昭和", "平成" };
16-int gannen[] = { 1, 1868, 1912, 1926, 1989 };
16+char *gengou[] = { "西暦" , "明治", "大正", "昭和", "平成", "令和" };
17+int gannen[] = { 1, 1868, 1912, 1926, 1989 , 2019 };
1718
1819
1920 void usage()
2021 {
21- printf("usage: age {Myy|Tyy|Syy|Hyy|yyyy}[/mm/dd]\n");
22+ printf("usage: age {Myy|Tyy|Syy|Hyy|Ryy|yyyy}[/mm/dd]\n");
2223 printf(" /mm/dd : birth day (If specified, display age.)\n");
2324 exit(1);
2425 }
@@ -58,6 +59,10 @@ int main(int a, char *b[])
5859 org_year = gannen[4]; /* 平成元年 */
5960 wareki = 1;
6061 break;
62+ case 'R':
63+ org_year = gannen[5]; /* 令和元年 */
64+ wareki = 1;
65+ break;
6166 default:
6267 if (strlen(ge) >= 4 &&
6368 ge[0] >= '0' && ge[0] <= '9' &&