Recent Changes - Search:

Oktatás

* Programozás 1
  + feladatsor
  + GitHub oldal

* Szkriptnyelvek
  + feladatsor
  + quick link

Teaching

* Programming 1 (BI)
  ◇ exercises
  ◇ quick link

teaching assets


Félévek

* 2024/25/2
* archívum


Linkek

* kalendárium
   - munkaszüneti napok '20
* tételsorok
* jegyzetek
* szakdolgozat / PhD
* ösztöndíjak
* certificates
* C lang.
* C++
* C#
* Clojure
* D lang.
* Java
* Nim
* Scala


[ edit | logout ]
[ sandbox | passwd ]

Read a string from the stdin

Let's mimic Python's input() function.

(1) input()
def main():
    name = input("Name: ")  # no extra newline char.
    print(f"Hello {name}!")
import std.stdio;
import std.string; // readln(), chomp()

string input(const string msg = "")
{
    write(msg);
    // chomp() removes the trailing newline
    return readln().chomp();
}

void main()
{
    string name = input("Name: ");
    writefln("Hello %s!", name);
}

Output:

Name: Lac
Hello Lac!
Cloud City

  

Blogjaim, hobbi projektjeim

* The Ubuntu Incident
* Python Adventures
* @GitHub
* heroku
* extra
* haladó Python
* YouTube listák


Debrecen | la France


[ edit ]

Edit - History - Print *** Report - Recent Changes - Search
Page last modified on 2025 June 27, 12:14