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?

[小技]整数の10のべき乗で遊ぶ。(マクロ(10から10000

Posted at

いろいろ注意

  • arduinoでの予定は、未定

プログラム

オンラインコンパイラpaiza




#define D_NUM 2

#if D_NUM == 1
    #define P_V 10
#endif

#if D_NUM == 2
    #define P_V 100
#endif

#if D_NUM == 3
    #define P_V 1000
#endif

#if D_NUM == 4
    #define P_V 10000
#endif


#include <iostream>
using namespace std;
int main(void){
    // Your code here!
    
    printf("10 ^ %d = %d\n",D_NUM,P_V);
    
}



10 ^ 2 = 100


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?