Created
July 13, 2020 15:12
-
-
Save LucaDantas/84a155ed1aec3e6bb8ec720985b562ed to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<bits/stdc++.h> | |
using namespace std; | |
int main() { | |
int dist; | |
cin >> dist; | |
// Retiramos os valores de antes e depois de entrar no ciclo | |
dist -= 5; | |
// Retiramos todas as repetições que ocorrem dentro do ciclo | |
dist %= 8; | |
// Como cada distância restante representa o sensor final do | |
// percurso, podemos simplesmente printar o valor restante | |
cout << dist << '\n'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment