Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
LinconRozendo authored Sep 7, 2020
1 parent e31e2be commit e0ac404
Show file tree
Hide file tree
Showing 23 changed files with 394 additions and 0 deletions.
14 changes: 14 additions & 0 deletions 1146.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#include<stdio.h>

while True:

n = int(input())

if n == 0:
break

for x in range(1, (n + 1), 1):
if x == n:
print(x)
else:
print(str(x) + ' ', end='')
20 changes: 20 additions & 0 deletions 1149.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#include<stdio.h>

n = input().split()

aux = 1
if int(n[aux]) <= 0:
while True:
if int(n[aux]) <= 0:
aux+= 1
if int(n[aux]) > 0:
break

a, n, aux = int(n[0]), int(n[aux]), int(n[0])

for x in range(1, n):
a += (aux + x)

print(a)


19 changes: 19 additions & 0 deletions 1150.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#include<stdio.h>

x = int(input())
aux = x
cont = 1
while True:
z = int(input())

if z > x:
break

for c in range(0, z):
if x <= z:
x += (aux + c)
cont += 1



print(cont)
30 changes: 30 additions & 0 deletions 1151.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#include<stdio.h>

n = int(input())

aux = 0
aux_2 = 0
c = 0

for x in range(1, (n + 1)):
if x == 1:
print(str(c) + ' ', end='')
c += 1
else:
if x == (n):
c += aux
print(c)
else:
if x == 3:
aux_2 = c
aux = 0
c += aux
print(str(c) + ' ', end='')
aux = aux_2
else:
aux_2 = c
c += aux
print(str(c) + ' ', end='')
aux = aux_2


8 changes: 8 additions & 0 deletions 1153.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#include<stdio.h>

n = int(input())

for x in range((n - 1), 0, -1):
n *= x

print(n)
14 changes: 14 additions & 0 deletions 1154.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#include<stdio.h>

t = 0
c = 0

while True:
n = int(input())

if n < 0:
print('%.2f' %(t / c))
break
else:
t += n
c += 1
10 changes: 10 additions & 0 deletions 1155.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#include<stdio.h>

s = 1
aux = 2

for x in range(3, 40, 2):
s+= (x / aux)
aux *= 2

print('%.2f' %(s))
7 changes: 7 additions & 0 deletions 1157.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#include<stdio.h>

n = int(input())

for x in range(1, (n + 1)):
if (n % x) == 0:
print(x)
18 changes: 18 additions & 0 deletions 1158.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#include<stdio.h>

n = int(input())

for c in range(0, n):
n = input().split()
x, y = int(n[0]), int(n[1])

if (x % 2) == 0:
x += 1

aux = x
x = 0

for d in range(aux, (aux + (y * 2)), 2):
x += d

print(x)
20 changes: 20 additions & 0 deletions 1159.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#include<stdio.h>



while True:
n = int(input())

if n == 0:
break

if (n % 2) != 0:
n += 1

aux = n
n = 0

for d in range(aux, (aux + (10)), 2):
n += d

print(n)
19 changes: 19 additions & 0 deletions 1160.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#include<stdio.h>
# http://muitomaiscodigoss.blogspot.com/2018/09/uri-problema-1160-crescimento.html #zzzzzzzzzzzzz

n = int(input())

for i in range(0, n):
pa, pb, ga, gb = map(float, input().split())
pa = int(pa)
pb = int(pb)
ano = 0
while pb >= pa:
pa = int(pa * (1 + ga / 100))
pb = int(pb * (1 + gb / 100))
ano = ano + 1
if ano >= 101:
print('Mais de 1 seculo.')
break
if ano <= 100:
print('%d anos.'%(ano))
16 changes: 16 additions & 0 deletions 1164.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#include<stdio.h>

n = int(input())

for i in range(0, n):
cont = 0
y = int(input())

for x in range(1, y):
if (y % x) == 0:
cont += x

if cont == y:
print('%d eh perfeito' %(y))
else:
print('%d nao eh perfeito' %(y))
16 changes: 16 additions & 0 deletions 1165.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#include<stdio.h>

n = int(input())

for i in range(0, n):
cont = 0
y = int(input())

for x in range(1, y):
if (y % x) == 0:
cont += 1

if cont == 1:
print('%d eh primo' %(y))
else:
print('%d nao eh primo' %(y))
12 changes: 12 additions & 0 deletions 1172.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#include<stdio.h>

v = []

for i in range(0, 10):
v.append(int(input()))

if v[i] <= 0:
v[i] = 1

for i in range(0, 10):
print('X[%d] = %d' %(i, v[i]))
15 changes: 15 additions & 0 deletions 1173.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#include<stdio.h>

v = []

n = int(input())

for i in range(0, 10):
if i == 0:
v.append(n)
else:
n *= 2
v.append(n)

for f in range(0, 10):
print('N[%d] = %d' %(f, v[f]))
10 changes: 10 additions & 0 deletions 1174.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#include<stdio.h>

v = []

for i in range(0, 100):
v.append(float(input()))

for f in range(0, 100):
if v[f] <= 10:
print('A[%d] = %.1f' %(f, v[f]))
11 changes: 11 additions & 0 deletions 1175.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#include<stdio.h>

v = []

for i in range(0, 20):
v.append(int(input()))

v.reverse()

for f in range(0, 20):
print('N[%d] = %d' %(f, v[f]))
31 changes: 31 additions & 0 deletions 1176.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#include<stdio.h>

v = []

x = 0
aux = 0
aux_2 = 0
for i in range(0, 100):
if i == 0:
v.append(0)
x += 1
else:
if i == 1:
aux = 0
x = 1
x += aux
v.append(x)
else:
aux_2 = x
x += aux
aux = aux_2
v.append(x)

n = int(input())

for j in range(0, n):
n = int(input())
print('Fib(%d) = %d' %(n, v[n]))



14 changes: 14 additions & 0 deletions 1177.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#include<stdio.h>

n = int(input())

aux = 0

for i in range(0, 1000):
print('N[%d] = %d' %(i, aux))
if aux == (n - 1):
aux = 0
else:
aux += 1


7 changes: 7 additions & 0 deletions 1178.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#include<stdio.h>

x = float(input())

for i in range(0, 100):
print('N[%d] = %.4f' %(i, x))
x /= 2
39 changes: 39 additions & 0 deletions 1179.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#include<stdio.h>

par = []
impar = []

tPar = 0
tImpar = 0

for i in range(0, 15):
n = int(input())

if (n % 2) == 0:
par.append(n)
tPar += 1
else:
impar.append(n)
tImpar += 1

if tPar == 5:
for j in range(0, tPar):
print('par[%d] = %d' %(j , par[j]))

del par [:]
tPar = 0

if tImpar == 5:
for j in range(0, tImpar):
print('impar[%d] = %d' %(j , impar[j]))

del impar [:]
tImpar = 0

if i == 14:
for j in range(0, tImpar):
print('impar[%d] = %d' %(j , impar[j]))

for j in range(0, tPar):
print('par[%d] = %d' %(j , par[j]))

Loading

0 comments on commit e0ac404

Please sign in to comment.