| 
				
				Напишите пожалуйста пару программ в си++
				 | 
 | 
Задача 1   Заданы числа a,b,c. Удвоить эти числа a>=b>=c и заменить их на абсолютные значения, если это не так.   Задача 2   Задано целое число n. Вычислить S=1+1/1!+1/2!+...+1/n!   Задача 3   Задано целое положительное число. Определить количество цифр в этом числе и их сумму.   Задача 4   Задан массив целых чисел. Увеличить все элементы этого массива начиная с первого положительного элемента в два раза. 
   Заранее спасибо
 
 |  
| 
 | 
  
 | 
Код в C# подойдёт?
  Нужна помощь? Сюда: vkontakte.ru/berestovskiy
 
 |  
| 
 | 
  
 | 
| 
 
 | 
1 
   class Program   {   static void Main(string[] args)   {   int a, b, c;   Console.WriteLine("Input A");   a = int.Parse(Console.ReadLine());   Console.WriteLine("Input B");   b = int.Parse(Console.ReadLine());   Console.WriteLine("Input C");   c = int.Parse(Console.ReadLine());   if (a >= b & b >= c)   {   a *= a;   b *= b;   c *= c;   }   else   {   a = Math.Abs(a);   b = Math.Abs(b);   c = Math.Abs©;   }   Console.WriteLine("A = " + a + " B = " + b + " C= " + c);   }   }
  Нужна помощь? Сюда: vkontakte.ru/berestovskiy
 
 |  
| 
 | 
  
 | 
2 
   class GetFactorial   {   public int Factorial(int n)   {   int fact = 1;   for (int i = 1; i <= n; i++)   {   fact *= i;   }   return fact;   }   }   class Program   {   
   static void Main()   {   GetFactorial Fctrl = new GetFactorial(); 
   Console.WriteLine("Input N");   int n = int.Parse(Console.ReadLine());   double sum = 0;   for (int i = 1; i <= n; i++)   {   sum = sum + (1 / Fctrl.Factorial(i));   }   Console.WriteLine("Sum = " + sum);   }   }
  Нужна помощь? Сюда: vkontakte.ru/berestovskiy
 
 |  
| 
 | 
  
 | 
3 
   ищи на форуме, когда-то кому-то писал)
  Нужна помощь? Сюда: vkontakte.ru/berestovskiy
 
 |  
| 
 | 
  
 | 
4 
   class Program   {   static void Main()   {   const int N = 10;   int[] Mass = new int[N];   int num = 0;   for (int i = 0; i < N; i++)   {   Console.WriteLine("Input Mass [" + i + "]");   Mass[i] = int.Parse(Console.ReadLine());     } 
   for (int i = 0; i < N; i++)   {   if (Mass[i] > 0)   {   num = i;   break;   }   }   for (int i = num; i < N; i++)   {   Mass[i] *= Mass[i];   }   for (int i = 0; i < N; i++)   {   Console.WriteLine(Mass[i].ToString());   } 
   }   }
  Нужна помощь? Сюда: vkontakte.ru/berestovskiy
 
 |  
| 
 | 
  
 |