09/01/12 11:32:28
>>682
#include <stdio.h>
#include <ctype.h>
#define BUFFSIZE 16
#define N 7
int main(void)
{
char buff[BUFFSIZE];
int i;
printf("学籍番号??? "); fgets(buff, BUFFSIZE, stdin);
for (i = 0; buff[i] != '\0'; ++i) if (!isdigit(buff[i])) break;
if (i != N) {
printf("学籍番号は7桁の数字で入力してください\n");
return 1;
}
buff[N] = '\0';
printf("e-mailアドレス: g%s@~~~~~~~~\n", buff);
return 0;
}