gonca16 Posted November 8, 2015 at 03:29 PM Report Share #589533 Posted November 8, 2015 at 03:29 PM (edited) Alguem sabe o que se passa aqui eu corro o programa e ele simplesmente nao faz nada numero=int(raw_input("escreva um inteiro:")) i=1 cont=0 while i<numero: if i%3==0: cont=cont+1 print cont Desde ja obrigado Edited November 8, 2015 at 04:46 PM by thoga31 Tags code + GeSHi Link to comment Share on other sites More sharing options...
Solution thoga31 Posted November 8, 2015 at 04:48 PM Solution Report Share #589538 Posted November 8, 2015 at 04:48 PM O programa está a trabalhar, mas está preso num ciclo infinito. A tua condição do while é i < numero, mas o valor de i está sequer a mudar ao longo do ciclo? 1 Report Knowledge is free! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now