-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
40 changed files
with
832 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#include <stdio.h> | ||
|
||
int main() { | ||
|
||
printf("Hello World!\n"); | ||
|
||
return 0; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#include <stdio.h> | ||
#include <math.h> | ||
|
||
int main(){ | ||
|
||
double raio, area; | ||
scanf("%lf", &raio); | ||
area = 3.14159 * pow(raio,2); | ||
printf("A=%.4lf\n", area); | ||
return 0; | ||
|
||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#include <stdio.h> | ||
|
||
int main(){ | ||
int A = 0, B = 0, C = 0, D = 0, DIFERENCA = 0; | ||
scanf("%d %d %d %d", &A, &B, &C, &D); | ||
DIFERENCA = (A * B - C * D); | ||
printf("DIFERENCA = %d\n", DIFERENCA); | ||
return 0; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#include <stdio.h> | ||
|
||
int main(){ | ||
int num, hora = 0; | ||
double valor, salario = 0; | ||
scanf("%d %d %lf", &num, &hora, &valor); | ||
salario = valor * hora; | ||
printf("NUMBER = %d\n", num); | ||
printf("SALARY = U$ %.2lf\n", salario); | ||
return 0; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#include <stdio.h> | ||
|
||
int main(){ | ||
int np1, np2, qnt1, qnt2 = 0; | ||
double vu1, vu2, vt = 0; | ||
scanf("%d %d %lf", &np1, &qnt1, &vu1); | ||
scanf("%d %d %lf", &np2, &qnt2, &vu2); | ||
vt = (qnt1 * vu1) + (qnt2 * vu2); | ||
printf("VALOR A PAGAR: R$ %.2lf\n", vt); | ||
return 0; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#include <stdio.h> | ||
#include <math.h> | ||
|
||
int main(){ | ||
double v = 0, r = 0; | ||
scanf("%lf", &r); | ||
v = (4.0/3) * 3.14159 * pow(r, 3); | ||
printf("VOLUME = %.3lf\n", v); | ||
return 0; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#include <stdio.h> | ||
#include <math.h> | ||
|
||
int main(){ | ||
int A, B, C, MaiorAB; | ||
scanf("%d %d %d", &A, &B, &C); | ||
MaiorAB =(A+B+abs(A-B))/2; | ||
MaiorAB=(C+MaiorAB+abs(MaiorAB-C))/2; | ||
printf("%d eh o maior\n",MaiorAB); | ||
return 0; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#include <stdio.h> | ||
|
||
int main(){ | ||
int dist = 0; | ||
double comb = 0, media = 0; | ||
scanf("%d %lf", &dist, &comb); | ||
media = dist / comb; | ||
printf("%.3lf km/l\n", media); | ||
return 0; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
#include <stdio.h> | ||
|
||
int main() | ||
|
||
{ | ||
|
||
|
||
|
||
double valor,D,E; | ||
|
||
|
||
|
||
|
||
int nota,b,d,f,h,j,B,m,o,q,s; | ||
|
||
int cem,cinquenta,vinte,dez,cinco,dois; | ||
|
||
int m_um,m_cinquenta,m_vintecinco,m_dez,m_cinco,m_umcent; | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
scanf ("%lf",&valor); | ||
|
||
|
||
|
||
nota=valor; | ||
|
||
cem=nota/100; | ||
|
||
b=nota%100; | ||
|
||
cinquenta=b/50; | ||
|
||
d=b%50; | ||
|
||
vinte=d/20; | ||
|
||
f=d%20; | ||
|
||
dez=f/10; | ||
|
||
h=f%10; | ||
|
||
cinco=h/5; | ||
|
||
j=h%5; | ||
|
||
dois=j/2; | ||
|
||
m_um=j%2; | ||
|
||
|
||
|
||
|
||
E=valor*100; | ||
|
||
B=(int) E; | ||
|
||
m=B%100; | ||
|
||
m_cinquenta=m/50; | ||
|
||
o=m%50; | ||
|
||
m_vintecinco=o/25; | ||
|
||
q=o%25; | ||
|
||
m_dez=q/10; | ||
|
||
s=q%10; | ||
|
||
m_cinco=s/5; | ||
|
||
m_umcent=s%5; | ||
|
||
|
||
|
||
|
||
printf ("NOTAS:\n"); | ||
|
||
printf ("%d nota(s) de R$ 100.00\n",cem); | ||
|
||
printf ("%d nota(s) de R$ 50.00\n",cinquenta); | ||
|
||
printf ("%d nota(s) de R$ 20.00\n",vinte); | ||
|
||
printf ("%d nota(s) de R$ 10.00\n",dez); | ||
|
||
printf ("%d nota(s) de R$ 5.00\n",cinco); | ||
|
||
printf ("%d nota(s) de R$ 2.00\n",dois); | ||
|
||
printf ("MOEDAS:\n"); | ||
|
||
printf ("%d moeda(s) de R$ 1.00\n",m_um); | ||
|
||
printf ("%d moeda(s) de R$ 0.50\n",m_cinquenta); | ||
|
||
printf ("%d moeda(s) de R$ 0.25\n",m_vintecinco); | ||
|
||
printf ("%d moeda(s) de R$ 0.10\n",m_dez); | ||
|
||
printf ("%d moeda(s) de R$ 0.05\n",m_cinco); | ||
|
||
printf ("%d moeda(s) de R$ 0.01\n",m_umcent); | ||
|
||
|
||
|
||
|
||
return 0; | ||
|
||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#include <stdio.h> | ||
int main(){ | ||
int A, B, C, D; | ||
scanf("%d %d %d %d", &A, &B, &C, &D); | ||
if(B > C && D > A && C + D > A + B && C > 0 && D > 0 && A % 2 == 0){ | ||
printf("Valores aceitos\n"); | ||
} | ||
else { | ||
printf("Valores nao aceitos\n"); | ||
} | ||
return 0; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#include <stdio.h> | ||
|
||
int main(){ | ||
float valor; | ||
scanf("%f", &valor); | ||
if(valor > 75 && valor <= 100){ | ||
printf("Intervalo (75,100]\n"); | ||
} | ||
else { | ||
if(valor > 50 && valor <= 75){ | ||
printf("Intervalo (50,75]\n"); | ||
} | ||
else { | ||
if(valor > 25 && valor <= 50) { | ||
printf("Intervalo (25,50]\n"); | ||
} | ||
else { | ||
if(valor >= 0 && valor <= 25) { | ||
printf("Intervalo [0,25]\n"); | ||
} | ||
else { | ||
printf("Fora de intervalo\n"); | ||
} | ||
} | ||
} | ||
} | ||
|
||
return 0; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#include <stdio.h> | ||
|
||
int main(){ | ||
int cod, quant = 0; | ||
double valor = 0; | ||
scanf("%d %d", &cod, &quant); | ||
switch(cod){ | ||
case 1 : valor = quant * 4.00; | ||
break; | ||
case 2 : valor = quant * 4.50; | ||
break; | ||
case 3 : valor = quant * 5.00; | ||
break; | ||
case 4 : valor = quant * 2.00; | ||
break; | ||
case 5 : valor = quant * 1.50; | ||
break; | ||
} | ||
printf("Total: R$ %.2lf\n", valor); | ||
return 0; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#include <stdio.h> | ||
int main() | ||
|
||
{ | ||
double a,b,c; | ||
scanf("%lf %lf %lf",&a,&b,&c); | ||
|
||
if (a < b + c && b < a + c && c < a + b) | ||
{ | ||
printf("Perimetro = %.1f\n", a + b + c); | ||
} | ||
else | ||
{ | ||
printf("Area = %.1f\n", c * (a + b) / 2); | ||
} | ||
return 0; | ||
|
||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#include <stdio.h> | ||
|
||
int main(){ | ||
int a, b; | ||
scanf("%d %d", &a, &b); | ||
if((a % b == 0) || (b % a == 0)){ | ||
printf("Sao Multiplos\n"); | ||
} | ||
else{ | ||
printf("Nao sao Multiplos\n"); | ||
} | ||
return 0; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#include <stdio.h> | ||
|
||
int main(){ | ||
int percent; | ||
float novo, reajuste, sal; | ||
scanf("%f", &sal); | ||
if(sal <= 400){ | ||
percent = 15; | ||
} | ||
else{ | ||
if(sal <= 800){ | ||
percent = 12; | ||
} | ||
else{ | ||
if(sal<= 1200){ | ||
percent = 10; | ||
} | ||
else{ | ||
if(sal<= 2000){ | ||
percent = 7; | ||
} | ||
else{ | ||
percent = 4; | ||
} | ||
} | ||
} | ||
} | ||
reajuste = (sal * percent) / 100; | ||
novo = sal + reajuste; | ||
printf("Novo salario: %.2f\n", novo); | ||
printf("Reajuste ganho: %.2f\n", reajuste); | ||
printf("Em percentual: %d %%\n", percent); | ||
return 0; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#include <stdio.h> | ||
|
||
int main(){ | ||
int num, cidade = 0; | ||
scanf("%d", &num); | ||
switch(num) { | ||
case 61 : printf("Brasilia\n"); | ||
break; | ||
case 71 : printf("Salvador\n"); | ||
break; | ||
case 11 : printf("Sao Paulo\n"); | ||
break; | ||
case 21 : printf("Rio de Janeiro\n"); | ||
break; | ||
case 32 : printf("Juiz de Fora\n"); | ||
break; | ||
case 19 : printf("Campinas\n"); | ||
break; | ||
case 27 : printf("Vitoria\n"); | ||
break; | ||
case 31 : printf("Belo Horizonte\n"); | ||
break; | ||
default: printf("DDD nao cadastrado\n"); | ||
|
||
} | ||
return 0; | ||
} |
Oops, something went wrong.