""convertir python a c ++" Code Answer's

You're definitely familiar with the best coding language C++ that developers use to develop their projects and they get all their queries like ""convertir python a c ++" answered properly. Developers are finding an appropriate answer about "convertir python a c ++ related to the C++ coding language. By visiting this online portal developers get answers concerning C++ codes question like "convertir python a c ++. Enter your desired code related query in the search bar and get every piece of information about C++ code related question on "convertir python a c ++. 

convertir python a c ++

By Zealous ZebraZealous Zebra on Jun 01, 2021
import sys

total=0 #cuenta el total de pixeles
cont=0 #cuanta aquellos <=1

def Leer (archivo):
     global total
     global cont
     f=open(archivo,'r')
     while(1):
        linea=f.readline()
        linea=linea[:-1]
####
        if(len(linea)>0):
          y=linea.split(";")
          print(y)
          total=total+len(y)
          for i in range(len(y)):
            if(int(y[i])<=1):
                cont+=1
	####
        if not linea:
            break
     f.close()
####
Leer ("imagen.txt")
print (total)

while(1):
	print("1.Cargar Imagen\n 2.Evaluar Imagen\n 3.salir\n")
	x=int(input("Ingrese una opcion:\n"))
	
	if (x==1):
		total=0
		cont=0 
		print("Cargar Imagen")
		Leer("imagen.txt")
	
	if(x==2):
		print("Evaluando imagen")
		print("TOTAL:"+str(total))
		print("CONT:"+str(cont))
	
		p=(cont/total)*100
	
		if(p>=50):
			print("Probabilidad de cobre: ALTA")
		if(p>=30 and p<50):
			print("Probabilidad de cobre: MEDIA")
		if(p<50):
			print("Probabilidad de cobre: BAJA")
	if(x==3):
		print("adios")	
		sys.exit(0)
	
	

Add Comment

0

All those coders who are working on the C++ based application and are stuck on "convertir python a c ++ can get a collection of related answers to their query. Programmers need to enter their query on "convertir python a c ++ related to C++ code and they'll get their ambiguities clear immediately. On our webpage, there are tutorials about "convertir python a c ++ for the programmers working on C++ code while coding their module. Coders are also allowed to rectify already present answers of "convertir python a c ++ while working on the C++ language code. Developers can add up suggestions if they deem fit any other answer relating to ""convertir python a c ++". Visit this developer's friendly online web community, CodeProZone, and get your queries like "convertir python a c ++ resolved professionally and stay updated to the latest C++ updates. 

C++ answers related to ""convertir python a c ++"

View All C++ queries

C++ queries related to ""convertir python a c ++"

Browse Other Code Languages

CodeProZone