Using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks;
namespace zn { class Program { public static void Main(string[] args) { int sum = 0; int m = 1; Console.Write("Введите n > "); int n = Convert.ToInt32(Console.ReadLine()); for(int i=0; i<n; i++) { Console.Write("Введите число > "); int c = Convert.ToInt32(Console.ReadLine()); if (c.ToString().EndsWith("3") || c.ToString().EndsWith("4")) sum += c; if (c % 5 == 0 && c % 3 != 0) m *= c; } Console.WriteLine("Сумма чисел заканчивающихся на 3 или на 4: " + sum); Console.WriteLine("Произведение чисел, делящихся на 5, но не на 3: " + m); Console.ReadKey(); } } }
Написано на Java - посмотрев на пример, можно сделать на любом другом языке.
import java.util.Scanner;
public class Operations { public static void main(String[] args) {
Scanner scanner = new Scanner(System.in); System.out.println("Введите два целых числа через пробел:"); int number1 = scanner.nextInt(); int number2 = scanner.nextInt();