Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
qwerty
Language:
Ada
Assembly
Bash
C#
C++ (gcc)
C++ (clang)
C++ (vc++)
C (gcc)
C (clang)
C (vc)
Client Side
Clojure
Common Lisp
D
Elixir
Erlang
F#
Fortran
Go
Haskell
Java
Javascript
Kotlin
Lua
MySql
Node.js
Ocaml
Octave
Objective-C
Oracle
Pascal
Perl
Php
PostgreSQL
Prolog
Python
Python 3
R
Rust
Ruby
Scala
Scheme
Sql Server
Swift
Tcl
Visual Basic
Layout:
Vertical
Horizontal
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.IO; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { string s; int k = 0,a,b; Console.WriteLine("Введите путь к файлу"); s = Console.ReadLine(); StreamReader F = new StreamReader(s); b = Convert.ToInt32(F.ReadLine()); for (; !F.EndOfStream; ) { a = Convert.ToInt32(F.ReadLine()); if ((a*b%2==1) && (a+b>0)) k++; a=b; } Console.WriteLine("количество пар соседних элементов файла, произведение которых нечётно, а сумма – положительна {0}",k); } } }
Show compiler warnings
[
+
]
Show input
edit mode
|
history
|
discussion