fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. int a;
  5. do{
  6. printf("1以上10以下の整数を入力してください\n");
  7. scanf("%d",&a);
  8. }
  9. while((a < 1) || (a > 10));
  10. printf("入力された数字は%dです",a);
  11. return 0;
  12. }
  13.  
Success #stdin #stdout 0s 5320KB
stdin
1
stdout
1以上10以下の整数を入力してください
入力された数字は1です