Jump to content
Welcome, Guest
Existing user? Sign In

Sign In



Sign Up
The MatriX
  • Welcome To Ghbsys
  • CS GO Streaming Version is released. Have fun streaming while cheating!
  • Have a Payment Issue? Send us a Support ticket.
  • Make a thread if you need support or join our discord for live support.
  • Have Suggestions? Make a thread and you'll earn Ghbsys Points for implemented suggestions.
  • Join our discord to stay well connected! Don't forget to integrate your discord to the site
  • Welcome to [GHB] - GAmEhAcKbAsTaRdS Forum

    Welcome to [GHB] - GAmEhAcKbAsTaRdS Forum, like most online communities you must register to view or post in our community, but don't worry this is a simple free process that requires minimal information for you to signup. Be apart of [GHB] - GAmEhAcKbAsTaRdS Forum by signing in or creating an account.
    • Start new topics and reply to others
    • Subscribe to topics and forums to get email updates
    • Get your own profile page and make new friends
    • Send personal messages to other members.

    Problem mit C# Rechner


    Xdab4yaX
     Share

    Recommended Posts

    Liebe Game Hack Bastards,

    Ich habe gerade angefangen C# zu lernen, doch bei meinem ersten Programm habe ich schon einen Fehler...

    Das ist der Code, ich denke jeder der C# kann, der wird verstehen, was dieses simple Programm bezwecken soll!

    Doch wenn ich es compiliere (Mit Visual C# 2008) Dann zeigt er mir nur diesen Text an:

    fehlergq1.jpg

    Dann gebe ich irgendeine Zahl ein und er schliesst sich wieder xD

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    
    namespace ConsoleApplication1
    {
    class Program
    {
    	static void Main(string[] args)
    	{
    		int zahl1;
    		int zahl2;
    		int zahl3;
    		Console.WriteLine("Bitte Geben sie die erste Zahl ein und drücken sie Enter.");
    		zahl1 = Console.Read();
    		Console.WriteLine("Geben sie nun die zweite Zahl ein und drücken sie Enter");
    		zahl2 = Console.Read();
    		zahl3 = zahl1 + zahl2;
    		Console.WriteLine("{0} + {1} = {2}",zahl1,zahl2,zahl3);
    		Console.ReadLine(); 
    	}
    }
    }

    Ich habe auch schon versucht nach zahl1 = Console.Read() ein Console.ReadLine() einzugügen, doch es half nichts!

    Bitte um Hilfe,

    Xdba4yaX

    Link to comment
    Share on other sites

    • 5 weeks later...

    so gehts:

     

    int zahl1;
    		int zahl2;
    		int zahl3;
    		Console.WriteLine("Bitte Geben sie die erste Zahl ein und drücken sie Enter.");
    		zahl1 = Convert.ToInt32(Console.ReadLine());
    		Console.WriteLine("Geben sie nun die zweite Zahl ein und drücken sie Enter");
    		zahl2 = Convert.ToInt32(Console.ReadLine());
    		zahl3 = zahl1 + zahl2;
    		Console.WriteLine("{0} + {1} = {2}", zahl1, zahl2, zahl3);
    		Console.ReadKey();

    Link to comment
    Share on other sites

    Guest
    This topic is now closed to further replies.
     Share

    • Recently Browsing   0 members

      • No registered users viewing this page.
    ×
    ×
    • Create New...