Posts by Darius da costa • 303 points
17 posts
-
1
votes2
answers162
viewsQ: Limit time to Cin input
I did a little research on, but I just find solutions spliced in C, but I use C++. The doubt is basically what the title says, whether it is possible to limit the time until the user input the cin.…
c++asked Darius da costa 303 -
-1
votes1
answer35
viewsQ: goto unsafe variable value
I’m making a simple code and I’m using the goto #include <iostream> using namespace std; int exemplo(void); int main() { exemplo(); } exemplo(){ comeco: { int numero; numero = 0; goto fim; }…
c++asked Darius da costa 303 -
0
votes3
answers142
viewsQ: Switch locks command when entering a letter
I’m making a code that uses switch (because the user can’t give any input) where I need the user to determine if r0 will have the integer value of 1 or 2, any other number will cause the question to…
c++asked Darius da costa 303 -
1
votes2
answers81
viewsQ: Variable not holding the assigned value
I’m doing a project and I came across a problem. #include "iostream" #include <cstdlib> using namespace std; int per2 (void); int per3 (void); int per4 (void); int main(void) { per2(); per3();…
c++asked Darius da costa 303 -
0
votes2
answers871
viewsQ: Use accents in the Cout command
Good afternoon. I know c++ uses another form of Asci, so there are no accents for example, so I come across problems like: int main() { cout << "é ó ê A ç"; } Returns: Ú ¾ Û A þ Is there any…
c++asked Darius da costa 303 -
1
votes2
answers535
viewsQ: Store diverse information in a batch notepad
Good morning, first I’ll put it in context. Basically I’m making an "interactive story", where basically, during the progress of history I’ll have 3 variables. I could save these variables with the…
-
0
votes2
answers524
viewsA: Problem with batch "set" command
@echo off cls set /a VAR=0 set /p NM1= set /p NM2= set /p NM3= set /p NM4= set /p NM5= set /p NM6= set /p NM7= set /p NM8= set /p NM9= set /p NM10= :CICLO if %NM10% EQU %NM9% ( goto IGUAL1 ) if…
-
0
votes2
answers524
viewsQ: Problem with batch "set" command
Good afternoon. I was doing a very simple programming, in general, serves simply to put the numbers that the user put (10 numbers) in ascending order, but something strange happens already in this…
-
0
votes2
answers50
viewsQ: Problem with batch comparisons
Good afternoon. I was making a simple batch file, in general, a friend of mine needed me to do that puzzle of 3 gallons of batch water (8, 5 and 3 liter gallons) In general the batch logic is very…
-
6
votes1
answer4113
viewsQ: Count of a specific character in a word in Python 3
I recently asked a similar question, but I received answers where my input was supposed to be a number. Is it possible to count how many specific characters you have in a word? As in "example" you…
-
3
votes2
answers1295
viewsQ: Count certain characters in a word in python
I’m making a command to help read a globe. entrada = int(input("Quantos centimetros no globo: ")) km = entrada * 425 m = km * 1000 cm = m * 100 print(entrada, "centimetros no globo equivalem a:",…
-
-2
votes1
answer157
viewsQ: Doubt command in Python
I am migrating from batch programming to Python, in batch there was the "goto" command, which basically created a sub-area within the command: goto EXEMPLO pause :EXEMPLO pause So, when the command…
pythonasked Darius da costa 303 -
0
votes1
answer356
viewsQ: Batch file to create another batch file
Is it possible for a batch file (EXEMPLO1.bat) to create another batch file (EXEMPLO2.bat) already programmed? Where I determine EXEMPLO2.bat programming within EXEMPLO1.bat.
-
0
votes1
answer597
viewsQ: Save the value of a variable on the outside and then import it in Batch
If I create a variable like this: set /a EXEMPLO=1 "EXAMPLE" is worth 1, can I save this information to the outside environment (in a file) and then import this value back to the same command? So,…
-
1
votes1
answer1234
viewsQ: Calculate two times in a batch variable
Is it possible to calculate the difference between two times with the batch and use the answer as a variable within the command? The "time" command allows you to make the calculations between start…
-
2
votes1
answer172
viewsQ: Determine an amount of time to respond to something in Batch
Is it possible to determine an amount of time for the user to answer a question in a batch? If I were to use a batch to shut down the computer, the user would have 1 minute to respond to something…
-
1
votes1
answer558
viewsQ: Clear only one row of a batch file
My question is whether there is any way to delete only one line of several. For example: the command prints three numbers on the screen of the prompt: echo 1 echo 2 echo 3 And then, he just erases…