Skip to content

Instantly share code, notes, and snippets.

@diogommartins
Last active March 28, 2018 23:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save diogommartins/0f5962f18da53cc7bbe1c29be709032c to your computer and use it in GitHub Desktop.
Save diogommartins/0f5962f18da53cc7bbe1c29be709032c to your computer and use it in GitHub Desktop.
#include<locale.h>
#include<stdio.h>
void main ()
{
// Cidade Quilometro
// Rio 9
// Minas 7
// Espirito Santo 6
// São Paulo 12
char destino[2];
int quilometros = 0;
printf("Digite o destino (RJ, SP, MG, ES) \n");
scanf("%s", destino);
if (strcmp(destino, "RJ") == 0){
quilometros = 6;
}
else if (strcmp(destino, "SP") == 0){
quilometros = 12;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment