namereq

include 2

Jul 29th, 2018
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.22 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main(void)
  4. {
  5.     int x;
  6.     printf("数を一つ入れてください。: ");
  7.     scanf("%d",&x);
  8.     for(;x>0;x/=10){
  9.         if(x%10 == 2){
  10.             printf("2が含まれています。\n");
  11.         }
  12.     }
  13.     return 0;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment