作业2
1.年月日转换 #include<stdio.h> int main() { int yyyy, mm, dd; printf("Enter a date(mm/dd/yyyy):"); scanf("%d/%d/%d", &mm, &dd, &yyyy); printf("you enter the date %.4d%.2d%.2d", yyyy, mm, dd); return 0; } 2.格式化 #include<stdio.h> int main() { int sm,mm, dd,yyyy; float price; printf("Enter item number:\n"); scanf("%d", &sm); printf("Enter unit price:\n"); scanf("%f", &price); printf("Enter purchase date(yyyy,mm,dd)"); scanf("%d/%d/%d",&yyyy,&mm,&dd); printf("Item\tUnitprice\tPurchase date\n"); printf("%d\t$%4.2f\t\t%d/%.2d/%.2d", sm, price, yyyy, mm, dd); return 0; } 3.ISBN #include<stdio.h> int main(