ProgIng - Programación en Ingeniería
Loading...
Searching...
No Matches
Ejemplo030.c
Go to the documentation of this file.
1
#include <stdio.h>
2
3
int
buscar
(
int
n)
4
{
5
return
n%2?n:
buscar
(n/2);
6
}
7
8
int
main
(
int
argc,
char
*argv[])
9
{
10
int
n, a, b, i, j, x;
11
scanf(
"%d"
, &n);
12
for
(i=0; i<n; i++)
13
{
14
scanf(
"%d %d"
, &a, &b);
15
for
(j=a, x=0; j<=b; j++)
16
{
17
printf(
"%d (%d)\t"
, j,
buscar
(j));
18
x +=
buscar
(j);
19
}
20
printf(
"%d\n"
, x);
21
}
22
return
0;
23
}
buscar
int buscar(int n)
Definition
Ejemplo030.c:3
main
int main(void)
Definition
Ejemplo_035.c:15
src
20252
Ejemplo030.c
Generated by
1.16.1