Ruka284 Posted August 9, 2012 at 10:36 PM Report Share #471912 Posted August 9, 2012 at 10:36 PM (edited) o que acham ?? #include <stdio.h> #include <stdlib.h> int main () { //variaveis int pais, selos, soma; //entrada de dados printf("quantos países temos"); scanf("%d", &pais); printf("quantos selos temos"); scanf("%d", &selos); //processamento soma = pais+selos; printf("o total de selos no classificador: %d" ,soma); //final do codigo fflush (stdin); getch (); return 0; } Edited August 9, 2012 at 11:14 PM by pmg adicionou GeSHi Link to comment Share on other sites More sharing options...
pikax Posted August 9, 2012 at 10:40 PM Report Share #471913 Posted August 9, 2012 at 10:40 PM o que acham ?? falta o geshi 🙂 mete o codigo entre [ code=c ] (codigo aqui) [ /code ] (sem espacos) em relacao ao codigo, nao percebi a soma 😄 de resto falta fechar a main 😄 Por muito mais que que estude só aprendo uma coisa, que ainda tenho muita coisa para aprender. A beleza de um código está em decompor problemas complexos em pequenos blocos simples. "learn how to do it manually first, then use the wizzy tool to save time." "Kill the baby, don't be afraid of starting all over again. Fail soon, learn fast." Link to comment Share on other sites More sharing options...
Ruka284 Posted August 9, 2012 at 10:48 PM Author Report Share #471916 Posted August 9, 2012 at 10:48 PM podes retificar para eu ver, s.f.f soma e entre país e selos vai dar o total Link to comment Share on other sites More sharing options...
pikax Posted August 9, 2012 at 10:50 PM Report Share #471917 Posted August 9, 2012 at 10:50 PM podes retificar para eu ver, s.f.f soma e entre país e selos vai dar o total quando puseres o codigo aqui no forum usa as tags [ code = c] #include <stdio.h> #include <stdlib.h> int main () { //variaveis int pais, selos, soma; //entrada de dados printf("quantos países temos"); scanf("%d", &pais); printf("quantos selos temos"); scanf("%d", &selos); //processamento soma = pais+selos; printf("o total de selos no classificador: %d" ,soma); //final do codigo fflush (stdin); getch (); return 0; } [ / code ] se tirares os espacos no code isto fica assim: #include <stdio.h> #include <stdlib.h> int main () { //variaveis int pais, selos, soma; //entrada de dados printf("quantos países temos"); scanf("%d", &pais); printf("quantos selos temos"); scanf("%d", &selos); //processamento soma = pais+selos; printf("o total de selos no classificador: %d" ,soma); //final do codigo fflush (stdin); getch (); return 0; } Por muito mais que que estude só aprendo uma coisa, que ainda tenho muita coisa para aprender. A beleza de um código está em decompor problemas complexos em pequenos blocos simples. "learn how to do it manually first, then use the wizzy tool to save time." "Kill the baby, don't be afraid of starting all over again. Fail soon, learn fast." Link to comment Share on other sites More sharing options...
Ruka284 Posted August 9, 2012 at 10:54 PM Author Report Share #471918 Posted August 9, 2012 at 10:54 PM porque metes code no incio e no fim. Link to comment Share on other sites More sharing options...
pikax Posted August 9, 2012 at 10:55 PM Report Share #471919 Posted August 9, 2012 at 10:55 PM porque metes code no incio e no fim. para ser mais facil para quem te esta a ajudar ver o codigo e compreender, o codigo fica com high-light. Por muito mais que que estude só aprendo uma coisa, que ainda tenho muita coisa para aprender. A beleza de um código está em decompor problemas complexos em pequenos blocos simples. "learn how to do it manually first, then use the wizzy tool to save time." "Kill the baby, don't be afraid of starting all over again. Fail soon, learn fast." Link to comment Share on other sites More sharing options...
Ruka284 Posted August 9, 2012 at 10:58 PM Author Report Share #471920 Posted August 9, 2012 at 10:58 PM eu agora aqui queria meter por país os selos que tenho desse país, podes dar uma dica Link to comment Share on other sites More sharing options...
pikax Posted August 9, 2012 at 10:59 PM Report Share #471921 Posted August 9, 2012 at 10:59 PM deves ter isso num ficheiro certo? Por muito mais que que estude só aprendo uma coisa, que ainda tenho muita coisa para aprender. A beleza de um código está em decompor problemas complexos em pequenos blocos simples. "learn how to do it manually first, then use the wizzy tool to save time." "Kill the baby, don't be afraid of starting all over again. Fail soon, learn fast." Link to comment Share on other sites More sharing options...
Ruka284 Posted August 9, 2012 at 11:03 PM Author Report Share #471922 Posted August 9, 2012 at 11:03 PM sim Link to comment Share on other sites More sharing options...
pikax Posted August 9, 2012 at 11:07 PM Report Share #471923 Posted August 9, 2012 at 11:07 PM sabes trabalhar com ficheiros? Por muito mais que que estude só aprendo uma coisa, que ainda tenho muita coisa para aprender. A beleza de um código está em decompor problemas complexos em pequenos blocos simples. "learn how to do it manually first, then use the wizzy tool to save time." "Kill the baby, don't be afraid of starting all over again. Fail soon, learn fast." Link to comment Share on other sites More sharing options...
Ruka284 Posted August 9, 2012 at 11:10 PM Author Report Share #471924 Posted August 9, 2012 at 11:10 PM abrir o ficheiro onde gravei este codigo ?? Link to comment Share on other sites More sharing options...
HappyHippyHippo Posted August 9, 2012 at 11:11 PM Report Share #471925 Posted August 9, 2012 at 11:11 PM tenta fazer coisas mais simples antes de te meteres por esses caminhos IRC : sim, é algo que ainda existe >> #p@p Portugol Plus Link to comment Share on other sites More sharing options...
Ruka284 Posted August 9, 2012 at 11:16 PM Author Report Share #471926 Posted August 9, 2012 at 11:16 PM com calma tudo se consegue. Link to comment Share on other sites More sharing options...
polska Posted August 10, 2012 at 11:12 AM Report Share #471945 Posted August 10, 2012 at 11:12 AM eu também não percebo bem o total, o total não seria mesmo apenas o número de selos? Se tens 5 selos e tens 5 países, o total de selos continua a ser 5.. A não ser que pretendas outra coisa que não percebi 😉 . Anyway, de resto parece-me bem 🙂 Corrige um sábio e ele mais sábio ficará. Corrige um ignorante e um inimigo ganharás. 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