Skip to content

Commit

Permalink
adicionando resoluções em C
Browse files Browse the repository at this point in the history
  • Loading branch information
hyskoniho committed Jun 13, 2024
1 parent 4e8a5de commit 121b7ed
Show file tree
Hide file tree
Showing 40 changed files with 832 additions and 0 deletions.
8 changes: 8 additions & 0 deletions 1. Iniciante/1000.c
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;
}
12 changes: 12 additions & 0 deletions 1. Iniciante/1002.c
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;

}
9 changes: 9 additions & 0 deletions 1. Iniciante/1007.c
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;
}
11 changes: 11 additions & 0 deletions 1. Iniciante/1008.c
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;
}
11 changes: 11 additions & 0 deletions 1. Iniciante/1010.c
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;
}
10 changes: 10 additions & 0 deletions 1. Iniciante/1011.c
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;
}
11 changes: 11 additions & 0 deletions 1. Iniciante/1013.c
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;
}
10 changes: 10 additions & 0 deletions 1. Iniciante/1014.c
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;
}
117 changes: 117 additions & 0 deletions 1. Iniciante/1021.c
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;

}
12 changes: 12 additions & 0 deletions 1. Iniciante/1035.c
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;
}
29 changes: 29 additions & 0 deletions 1. Iniciante/1037.c
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;
}
21 changes: 21 additions & 0 deletions 1. Iniciante/1038.c
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;
}
18 changes: 18 additions & 0 deletions 1. Iniciante/1043.c
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;

}
13 changes: 13 additions & 0 deletions 1. Iniciante/1044.c
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;
}
34 changes: 34 additions & 0 deletions 1. Iniciante/1048.c
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;
}
27 changes: 27 additions & 0 deletions 1. Iniciante/1050.c
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;
}
Loading

0 comments on commit 121b7ed

Please sign in to comment.