0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

[例題の為の例題]対象"..-0A"を16進以外を読み飛ばしにせよ!!!(オンラインコンパイラ)

Last updated at Posted at 2025-10-05

いろいろ注意

  • (便利な言葉)過去ログを見よ!!!
  • いろいろ、明日(20251006)は、m5stackのイベントなので課題を片付けよう(何のこと

プログラム

  • オンラインコンパイラ


//0 1 2 3 4 5 6 7 8 9 A B C D E F
char t[] = {
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, //00
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, //10
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, //20
0,1,2,3,4,5,6,7,8,9,0,0,0,0,0,0, //30

0,10,11,12,13,14,15,0,0,0,0,0,0,0,0,0, //40
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, //50
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, //60
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, //70

0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, //80
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, //90
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, //A0
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, //B0

0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, //C0
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, //D0
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, //E0
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0  //F0
};

#include <iostream>
using namespace std;
int main(void){
    // Your code here!
    
    unsigned char p[]="..-0A";
    

    int i = 0; //カウンター
    int a; //一時領域
    
    //構造化プログラミング先読み
    a = p[i]; //読み出し
    
    while((t[a] == 0) && (a != '0') && (a != 0)){
        
       printf("[%c]",a); //debug
       
       i++; 
       a = p[i]; //読み出し
       
    }  //while
    
    //printf("(%c)",p[i]); //debug
    
    printf("\n");
    
}  //main



[.][.][-]

おまけ

  • 16進の間


//0 1 2 3 4 5 6 7 8 9 A B C D E F
char t[] = {
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, //00
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, //10
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, //20
0,1,2,3,4,5,6,7,8,9,0,0,0,0,0,0, //30

0,10,11,12,13,14,15,0,0,0,0,0,0,0,0,0, //40
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, //50
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, //60
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, //70

0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, //80
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, //90
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, //A0
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, //B0

0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, //C0
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, //D0
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, //E0
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0  //F0
};

#include <iostream>
using namespace std;
int main(void){
    // Your code here!
    
    unsigned char p[]="0123456789pABCDEFp";
    

    int i = 0; //カウンター
    int a; //一時領域
    
    //構造化プログラミング先読み
    a = p[i]; //読み出し
    
    while( ((t[a] != 0) || (a == '0')) && (a != 0)){
        
       printf("[%c]",a); //debug
       
       i++; 
       a = p[i]; //読み出し
       
    }  //while
    
    printf("(%c)",p[i]); //debug
    
    printf("\n");
    
}  //main



0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?