Skip to content
Snippets Groups Projects
Select Git revision
  • 56fb6a5d1f15565b367dd91c726dd2520cb16648
  • master default protected
  • opencv4
  • custom_realsense
  • deproject
  • camera
6 results

camera.cpp

Blame
  • ppcm_bis.c 691 B
    #include <stdio.h>
    #include <stdlib.h>
    #include <math.h>
    #include <stdbool.h>
    
    void main() {
       int n = 15,m = 12;
       printf("Entrez n et m:\n");
       scanf("%d %d",&n,&m);
       int tmp_n = n,tmp_m = m;
    
    /*
       while (tmp_n != tmp_m) {
          if (tmp_n < tmp_m) {
             tmp_n += n;
          } else {
             tmp_m += m;
          }
       }
    
       while (true) {
          if (tmp_n < tmp_m) {
             tmp_n += n;
          } else if (tmp_n > tmp_m) {
             tmp_m += m;
          } else {
             break;
          }
       }
    */
    
       do {
          if (tmp_n < tmp_m) {
             tmp_n += n;
          } else { 
             tmp_m += m;
          } 
       } while (tmp_n != tmp_m);
    
       printf("Le ppcm de %d et %d est %d\n",n,m,tmp_m);
    }