Questions tagged as 'loop'

3
answers

Function that calculates the factorial of a number [closed]

int fatorial(int n, int f){ int resultado; while(n>1){ f=1; resultado=(n*f); f=f-1; } return (resultado); } int main(void){ int resultado; int n; int f; printf("Digite o numero a ser fatorado:\n"); scanf("%d", &n); resultado=fatorial(n,f)...
asked by 02.10.2018 / 23:46
2
answers

loop of repetition C # asp components

Would you like to make a loop in this case? PaperBLL paperBLL = new PaperBLL(); List<PaperEO> papers = paperBLL.SelectPapers(); HyperLink1.ImageUrl = "~/App_Themes/MultiMercadoLibertyExclusiva/Capas/" + papers.First(x => x.id == 1)....
asked by 02.07.2014 / 19:17
1
answer

Perfect numbers

algoritmo "numeros_perfeitos" var c, n:inteiro nv, np, npv:real inicio para n <- 1 ate 100 faca para c <- 1 ate n faca se n % c = 0 entao nv <- n / c se nv < n entao np <- nv + np fimse...
asked by 03.10.2017 / 15:19
2
answers

Displaying certain vectors in a 2D Python list

I have the following situation: - I have a variable called (distrow_vector). This variable receives a 2D list with multiple vectors. - I want it to be displayed, only vectors whose sum of their indexes are less than 100. - I have the code below,...
asked by 26.02.2017 / 19:43
1
answer

Eliminate code redundancy in a while loop

In this example: . Ask for today's date via a form. . Check if it was typed in dd / mm / yyyy format. . Compare with the current system date from datetime import date def verificacaoData(): dataForm = input('Digite a data atual no pad...
asked by 21.11.2017 / 16:28
2
answers

Using For in Python

In Python it is only possible to work with 'for' (loop ) using a list? Is not it possible only with an integer like in other languages?     
asked by 15.11.2016 / 03:17
1
answer

How to extract space-separated words via Javascript

Continuing the marathon of articles regarding extraction of texts, I noticed that this type of question is very difficult to find next to a clear and direct answer. In order to take away my doubt and certainly the one of other users, today's...
asked by 14.05.2017 / 14:25
1
answer

How to get the number of rows from a StringList and apply?

I have a StringList inside a mensagens.txt file, I would like to count how many rows have this StringList contained within that file. For each line of the string 1 code will be run in plugin code. If StringList...
asked by 08.02.2018 / 04:27
1
answer

Infinite Loop, object orientation

Stack Overflow . Stack Overflow I have a function to list all tickets for the user who is logged in: public function list_ticket() { try { $session = $_SESSION[SESSION_PREFIX . 'email_username']; $sql =...
asked by 04.02.2016 / 19:39
1
answer

Concatenate in loop with jQuery

I need to concatenate with jQuery all input values that have classes that start with "item_". I'm using the function below but it did not work. $(document).ready(function() { $('button.vai').click(function(){ var item = $("input[cla...
asked by 17.09.2015 / 03:54