**C言語 [#eb33dda4]
#geshi(c,number){{
#include <stdio.h>
#define MAX 41
#author("2026-07-22T05:41:00+09:00;2023-02-23T23:33:35+09:00","default:vip","vip")
**C言語 [#top]
//#geshi(c,number){{
 #include <stdio.h>
 #define MAX 41
 
 /* 判定 */
 int judge(const int x){
   int i;
   if(x % 3 == 0)
     return 1;
 
   for(i=x; i; i /= 10)
     if(i % 10 == 3)
       return 1;
   
   return -1;
 }
 
 int main(){
   int i;
   for(i=1; i <= MAX; i++){
     if(judge(i) == -1)
       printf("%d\n", i);
     else
       printf("Aho\n");
   }
 
   return 0;
 }
//}}

/* 判定 */
int judge(const int x){
  int i;
  if(x % 3 == 0)
    return 1;

  for(i=x; i; i /= 10)
    if(i % 10 == 3)
      return 1;
  
  return -1;
}

int main(){
  int i;
  for(i=1; i <= MAX; i++){
    if(judge(i) == -1)
      printf("%d\n", i);
    else
      printf("Aho\n");
  }

  return 0;
}
}}


トップ   編集 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS