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?

10を引けるだけ引くアルゴリズムを考えて遊ぶ。 A➗10🟰N10•••A

Last updated at Posted at 2025-09-16

いろいろ注意

  • arduino unoでの予定は、未定
  • なぜか、ややヒット

目的

乗除算器なしのCPUで10で割る
イメージとしては、Z80やPIC

プログラム

オンラインコンパイラpaiza


#include <iostream>
using namespace std;
int main(void){
    // Your code here!
    int N10 = 0;
    int A = 46;
    
    while(A > 9){
        //printf("in while\n"); //debug
        
        A = A - 10;
        N10 = N10 + 1;
        
    }  //while
    
    printf("N10=%d,A=%d\n",N10,A);
    
}  //main


N10=4,A=6

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?