1
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?

俺用、0からの範囲を判定するマクロ

Last updated at Posted at 2025-04-29

いろいろ、注意

  • Arduino UNOでの 予定は、未定
  • いろいろ 簡単だけど いろいろあって プログラムを短くしたい
  • RE は、 レンジ の 事
  • 朝、ギリギリ10分前から初めて、間に合った

プログラム

オンラインコンパイラ paiza




#define RE(A,X) ( (X >= 0) && (X <= A)  )

#include <iostream>
using namespace std;
int main(void){
    // Your code here!
    
    for(int i=-1;i<=7;i++){
        if( RE(5,i) ) {
            printf("RE(5,%d) YES\n",i);
        } else {
            printf("RE(5,%d) NO\n",i);
        }
    }
    
}



RE(5,-1) NO
RE(5,0) YES
RE(5,1) YES
RE(5,2) YES
RE(5,3) YES
RE(5,4) YES
RE(5,5) YES
RE(5,6) NO
RE(5,7) NO


1
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
1
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?