Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)
Paste
Pasted as Plain Text by 11 ( 12 years ago )
#include <stdio.h>
#include <locale.h>
/*
int main(int argc, char *argv[])
{
setlocale(LC_ALL, "RU");
printf("Привет, мир\n");
return 0;
}
//Сумма от А до Б
int main()
{ setlocale(LC_ALL, "RU");
int A,B,S=0;
printf("Введите А и B (A<B)\n");
scanf ("%d %d", &A,&B);
for (int i = A; i < B; i++)
{
S=S+i;
}
printf ("Сумма чисел от А до В равно %d\n",S);
return 0;
}
//Произведение от 1 до N
int main()
{ setlocale(LC_ALL, "RU");
int N,S=1;
printf("Введите N (N>1)\n");
scanf ("%d", &N);
for (int i =1; i<=N; i++)
{
S=S*i;
}
printf ("Произведение от 1 до %d равно %d\n", N,S);
return 0;
}
//Задача 3
int main()
{ setlocale(LC_ALL, "RU");
int N,a,k=0;
printf("Введите N (N>0)\n");
scanf ("%d", &N);
a=N;
while (1<N)
{
N=N/2;
k++;
}
printf ("Ответ: 2 в степени %d равен %d\n", k,a);
return 0;
}
*/
Revise this Paste