Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
tool
using System; string[] name = new string[99]; string[] fs = new string[99]; int[] degree = new int[99]; int numberofstudent; Console.Write("how many of student do you have ?"); numberofstudent = int.Parse(ConsoleInput.ReadToWhiteSpace(true)); Console.Write("/n/n"); int loop = numberofstudent; int counter = 0; for(int i = numberofstudent; numberofstudent > 0; numberofstudent--) { Console.Write(" the name of tudent number "); Console.Write(counter + 1); Console.Write(" is : "); name[counter] = ConsoleInput.ReadToWhiteSpace(true); Console.Write("his mark is : "); degree[counter] = int.Parse(ConsoleInput.ReadToWhiteSpace(true)); if (degree[counter] >= 60) { fs[counter] = "passed"; } else { fs[counter] = "failed"; } counter = counter + i; } Console.Write("/n/n"); int c = 0; for (int x= loop; loop > 0; loop--) { Console.Write(" l "); Console.Write(name [c]); Console.Write(" l "); Console.Write(degree [c]); Console.Write(" l "); Console.Write(fs[c]); //C++ TO C# CONVERTER TODO TASK: The following line uses invalid syntax: //cout << "/n ـــــــــــــ /n; c = c + i; } //Helper class added by C++ to C# Converter: //---------------------------------------------------------------------------------------- // Copyright © 2006 - 2021 Tangible Software Solutions, Inc. // This class can be used by anyone provided that the copyright notice remains intact. // // This class provides the ability to convert basic C++ 'cin' and C 'scanf' behavior. //---------------------------------------------------------------------------------------- internal static class ConsoleInput { private static bool goodLastRead = false; public static bool LastReadWasGood { get { return goodLastRead; } } public static string ReadToWhiteSpace(bool skipLeadingWhiteSpace) { string input = ""; char nextChar; while (char.IsWhiteSpace(nextChar = (char)System.Console.Read())) { //accumulate leading white space if skipLeadingWhiteSpace is false: if (!skipLeadingWhiteSpace) input += nextChar; } //the first non white space character: input += nextChar; //accumulate characters until white space is reached: while (!char.IsWhiteSpace(nextChar = (char)System.Console.Read())) { input += nextChar; } goodLastRead = input.Length > 0; return input; } public static string ScanfRead(string unwantedSequence = null, int maxFieldLength = -1) { string input = ""; char nextChar; if (unwantedSequence != null) { nextChar = '\0'; for (int charIndex = 0; charIndex < unwantedSequence.Length; charIndex++) { if (char.IsWhiteSpace(unwantedSequence[charIndex])) { //ignore all subsequent white space: while (char.IsWhiteSpace(nextChar = (char)System.Console.Read())) { } } else { //ensure each character matches the expected character in the sequence: nextChar = (char)System.Console.Read(); if (nextChar != unwantedSequence[charIndex]) return null; } } input = nextChar.ToString(); if (maxFieldLength == 1) return input; } while (!char.IsWhiteSpace(nextChar = (char)System.Console.Read())) { input += nextChar; if (maxFieldLength == input.Length) return input; } return input; } }
run
|
edit
|
history
|
help
0
XmlException in XmlSerializer.Deserialize when XML has \0
ToBase64String
abcd
726
IntToExcelColumnNotation
Ki
Helloworld
23
equation with a variable on the 2nd power
barcos