Jump to content

Recommended Posts

Posted

εάν δεν το κάνεις μόνος σου δεν έχει αξία , και επίσης δεν βλέπω κάτι το δύσκολο στον κώδικα εκτός από το 1) που δεν έχω ιδέα για το πως γίνεται ... ( επίσης δεν έχω ιδέα από c# αλλά από την ΓΛΩΣΣΑ που κάνουμε σχολείο μπορώ να κάνω ένα πρόγραμμα με τα 2-3 )

Posted

εάν δεν το κάνεις μόνος σου δεν έχει αξία , και επίσης δεν βλέπω κάτι το δύσκολο στον κώδικα εκτός από το 1) που δεν έχω ιδέα για το πως γίνεται ... ( επίσης δεν έχω ιδέα από c# αλλά από την ΓΛΩΣΣΑ που κάνουμε σχολείο μπορώ να κάνω ένα πρόγραμμα με τα 2-3 )

thelei code se Visual C#
Posted

 

Ekana To 1o Erwtima:

using System;

class Lab1Ex1

{

    public static void Main()

    {

 

 

        Console.WriteLine("Username:");

        string username = Console.ReadLine();

        Console.WriteLine("Password:");

        string password = Console.ReadLine();

       

 

        if (username == "admin" && password == "admin")

        {

            Console.WriteLine("You are now logged !!!");

        }

             

        else

        {

            Console.WriteLine("Invalid Username Or Password !!!");

        }

            Console.ReadKey(); 

        }

    }

 

===========================================

Dn mporw na valw orio gia 3 prospathies.....pws ginete auto ??? 

     

Posted

Dn mporw na valw orio gia 3 prospathies.....pws ginete auto ??? 

     

ευκολα γινεται με ενα for ή while loop.

καντο με while καλυτερα , δημιουργησε μια μεταβλητη int που θα ειναι οι ευκαιριες.

μεσα στο while οποτε χρειαζεται θα αυξανεται κατα μια , φυσικα δε θα γινεται να χρησιμοποιησουν αλλες λειτουργιες αν δεν εχουν αλλη ευκαιρια.

 

while(eukeries < 3)

{

//blabla

}

Posted

Και αυτό είναι project? Ω θεέ μου τι σκατά σας μαθαίνουν...

 

Τέσπα on the point:

 

Για το "μενού επιλογών" η λογική είναι να τρέξεις έναν ατέρμων βρόγχο (while (true) {}) και να εμφανίζεις τις επιλογές καθώς και να παίρνεις είσοδο από το χρήστη. Ανάλογα τι θα πατήσει καλείς και ένα συγκεκριμένο function που θα κάνει ό,τι ζητάει το κάθε ερώτημα. Μόλις τελειώσει το function, θα γυρίσει στο menu επιλογών (ο ατέρμων βρόγχος του while) και θα μπορεί ο άλλος να ξαναπατήσει ό,τι θέλει. Άμα πατήσει 0, κάνεις break από το βρόγχο και τερματίζεις το πρόγραμμά σου κανονικά. Όσο για τα υπόλοιπα ερωτήματα, είναι πολύ απλά και δεν απαιτούν πάνω από μισή ώρα γραψίματος.

 

Ελπίζω να βοήθησα...

Posted

using System;

class Lab1Ex1

{

public static void Main()

{

 

 

Console.WriteLine("Username:");

string username = Console.ReadLine();

Console.WriteLine("Password:");

string password = Console.ReadLine();

 

if (username == "admin" && password == "admin")

{

Console.WriteLine("You are now logged !!!\n");

{

{

 

Console.WriteLine("MiniProject C#\n");

 

Console.WriteLine("1 - Ypologismos Ginomenou");

Console.WriteLine("2 - Megistos Koinos Diairetis");

Console.WriteLine("3 - 3psifioi Arithmoi Harshad");

Console.WriteLine("0 - Exit\n");

 

Console.Write("Epiloges (1,2,3,or 0): ");

 

 

}

string menu;

menu = Console.ReadLine();

switch (menu)

{

case "1":

Console.WriteLine("1o Erwmima.");

break;

case "2":

Console.WriteLine("2o erwtima.");

break;

case "3":

Console.WriteLine("3o erwtima.");

break;

case "0":

Console.WriteLine("Bye.");

break;

default:

Console.WriteLine("Lathos Epilogi!!!", menu);

break;

}

}

}

else

{

Console.WriteLine("Invalid Username Or Password !!!");

}

Console.ReadKey();

}

}

====================================================================================

Δεν μπορώ να βάλω την επανάληψη [do while (menu != "0" && menu != "0");] ώστε να γυρίζει συνέχεια στο μενού μεχρι ο χρηστης να πατήσει το 0....

Posted

using System;

class Lab1Ex1

{

public static void Main()

{

 

 

Console.WriteLine("Username:");

string username = Console.ReadLine();

Console.WriteLine("Password:");

string password = Console.ReadLine();

 

if (username == "admin" && password == "admin")

{

Console.WriteLine("You are now logged !!!\n");

{

{

 

Console.WriteLine("MiniProject C#\n");

 

Console.WriteLine("1 - Ypologismos Ginomenou");

Console.WriteLine("2 - Megistos Koinos Diairetis");

Console.WriteLine("3 - 3psifioi Arithmoi Harshad");

Console.WriteLine("0 - Exit\n");

 

Console.Write("Epiloges (1,2,3,or 0): ");

 

 

}

string menu;

menu = Console.ReadLine();

switch (menu)

{

case "1":

Console.WriteLine("1o Erwmima.");

break;

case "2":

Console.WriteLine("2o erwtima.");

break;

case "3":

Console.WriteLine("3o erwtima.");

break;

case "0":

Console.WriteLine("Bye.");

break;

default:

Console.WriteLine("Lathos Epilogi!!!", menu);

break;

}

}

}

else

{

Console.WriteLine("Invalid Username Or Password !!!");

}

Console.ReadKey();

}

}

====================================================================================

Δεν μπορώ να βάλω την επανάληψη [do while (menu != "0" && menu != "0");] ώστε να γυρίζει συνέχεια στο μενού μεχρι ο χρηστης να πατήσει το 0....

 

Αυτό ακριβώς πρέπει να κάνεις. Δηλαδή...

 


Console.WriteLine("1 - Ypologismos Ginomenou");
Console.WriteLine("2 - Megistos Koinos Diairetis");
Console.WriteLine("3 - 3psifioi Arithmoi Harshad");
Console.WriteLine("0 - Exit\n");

Console.Write("Epiloges (1,2,3,or 0): ");

menu = Console.ReadLine();
while (menu != "0") { 
       
       // Χειρισμός των επιλογών όπως έχεις ήδη κάνει με switch ;)
    
       Console.WriteLine("1 - Ypologismos Ginomenou");
       Console.WriteLine("2 - Megistos Koinos Diairetis");
       Console.WriteLine("3 - 3psifioi Arithmoi Harshad");
       Console.WriteLine("0 - Exit\n");  

       Console.Write("Epiloges (1,2,3,or 0): ");

       menu = Console.ReadLine();
}

  • 3 weeks later...
Posted

κάτι πρόχειρο αλλά δουλεύει νομίζω

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main()
        {
            string[] args = new string[2];
            args[0] = "username";
            args[1] = "password";

            int fAttempts = 0;

            while (fAttempts <= 3)
            {
                Console.WriteLine("Username:");
                string username = Console.ReadLine();
                Console.WriteLine("Password:");
                string password = Console.ReadLine();
                if (username == args[0] && password == args[1])
                {
                    break; //exit while
                }
                else { fAttempts++; Console.WriteLine("Login failed invalid credentials!\n"); }
            }
            if (fAttempts == 3) { Console.WriteLine("Your login attempts limit has been reached, application will now exit!"); Console.ReadLine(); return; } //Exit

            int menu = 1;
                    
            while (menu != 0)
            {
                showMenu();
                menu = Convert.ToInt32(Console.ReadLine()); //ksanadiavazei

                if (menu == 1)
                {
                    Console.WriteLine("Dwse to M:");
                    int m = Convert.ToInt32(Console.ReadLine());

                    if (m>0)
                    {
                        int sum = 0;
                        int tSum = 0;

                        int i;
                        for (i = 0; i <= m; i++)
                        {
                            if (sum >= m) break;
                            sum = sum * 2 + 1; // ((0x2) + 1 ),(1x2)+1) klp klp
                            tSum += sum;
                           // Console.WriteLine(sum + "\n");
                        }
                        Console.WriteLine(tSum + "\n");
                    }
                }
                else if (menu == 2)
                {
                    Console.WriteLine("Dwse prwto akeraio:");
                    int a = Convert.ToInt32(Console.ReadLine());
                    Console.WriteLine("Dwse deutero akeraio:");
                    int b = Convert.ToInt32(Console.ReadLine());
                    Console.WriteLine(gcd(a, b));
                }
                else if (menu == 3)
                {
                    int i = 100;
                    for (i = 100; i <= 999; i++)
                    {
                        int f = (i / 100) % 10;
                        int s = (i / 10) % 10;
                        int t = i % 10;
                        int sum = f + s + t;
                        if (i % sum == 0) Console.WriteLine(i+",");
                    }
                    Console.WriteLine("\n");
                }
                else if (menu == 0)
                {
                    Console.WriteLine("The application will not exit, you typed 0!");
                    Console.ReadLine();
                    return;
                }
            }

        }

        static int gcd(int u, int v)
               {
                // simple cases (termination)
                 if (u == v)
                 return u;
                if (u == 0)
                 return v;
                if (v == 0)
                 return u;

              // look for factors of 2
                if (u%2==0) // u is even
                if (v%2==1) // v is odd
                return gcd(u >> 1, v);
                else // both u and v are even
                return gcd(u >> 1, v >> 1) << 1;
                if (v%2==0) // u is odd, v is even
                return gcd(u, v >> 1);

                // reduce larger argument
                if (u > v)
                return gcd((u - v) >> 1, v);
                return gcd((v - u) >> 1, u);
                }

        static void showMenu()
        {
            Console.WriteLine("MiniProject C#\n");

            Console.WriteLine("1 - Ypologismos Ginomenou");
            Console.WriteLine("2 - Megistos Koinos Diairetis");
            Console.WriteLine("3 - 3psifioi Arithmoi Harshad");
            Console.WriteLine("0 - Exit\n");

            Console.Write("Epiloges (1,2,3,or 0): ");
        }
    }
}

 

se VS 2008

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Posts

    • Server owners, Top.MaxCheaters.com is now live and accepting Lineage 2 server listings. There is no voting, no rankings manipulation, and no paid advantages. Visibility is clean and equal, and early listings naturally appear at the top while the platform grows. If your server is active, it should already be listed. Submit here https://Top.MaxCheaters.com This platform is part of the MaxCheaters.com network and is being built as a long-term reference point for the Lineage 2 community. — MaxCheaters.com Team
    • ⚙️ General Changed “No Carrier” title to “Disconnected” to avoid confusion after abnormal DC. On-screen Clan War kill notifications will no longer appear during Sieges, Epics, or Events. Bladedancer or SwordSinger classes can now log in even when Max Clients (2) is reached, you cannot have both at the same time. The max is 3 clients. Duels will now be aborted if a monster aggros players during a duel (retail-like behavior). Players can no longer send party requests to blocked players (retail-like). Fixed Researcher Euclie NPC dialogue HTML error. Changed Clan leave/kick penalty from 12 hours to 3 hours. 🧙 Skills Adjusted Decrease Atk. Spd. & Decrease Speed land rates in Varka & FoG. Fixed augmented weapons not getting cooldown when entering Olympiad. 🎉 Events New Team vs Team map added. New Save the King map added (old TvT map). Mounts disabled during Events. Letter Collector Event enabled Monsters drop letters until Feb. 13th Louie the Cat in Giran until Feb. 16th Inventory slots +10 during event period 📜 Quests Fixed “Possessor of a Precious Soul Part 1” rare stuck issue when exceeding max quest items. Fixed Seven Signs applying Strife buff/debuff every Monday until restart. 🏆 Milestones New milestone: “Defeat 700 Monsters in Varka” 🎁 Rewards: 200 Varka’s Mane + Daily Coin 🌍 NEW EXP Bonus Zones Hot Springs added Varka Silenos added (hidden spots excluded) As always, thank you for your support! L2Elixir keeps evolving, improving, and growing every day 💙   Website: https://l2elixir.org/ Discord: https://discord.gg/5ydPHvhbxs
    • https://sms.pro/ — we are an SMS activation platform  seeking partners  mobile number providers  mobile number owners  owners of GSM modems  SIM card owners We process 1,000,000 activations every day.  寻找合作伙伴  手机号码提供商  手机号码持有者  GSM调制解调器持有者  SIM卡持有者 我们每天处理1,000,000次激活。  Ищем партнеров  Владельцы сим карт  провайдеров  владельцев мобильных номеров  владельцев модемов  Обрабатываем от 1 000 000 активаций в день ⚡️ Fast. Reliable.   https://sms.pro/ Support: https://t.me/alismsorg_bot
    • "WHAT I WILL SEE ON NEW SEASON ? *More easy farm and augment than ever before ! *Free VIP characters for everyone for first 2 days after opening ! Improved olympiad engine to work more correctly. 3 New skins / outfits. Fixed raid boss spawns. Fixed olympiad crit errors. New farming Ivory Tower area. Fixed augmentation rate. Increased all mob drops rate by +20%. And much more..."   1. I have clicked VIP 23.01.2026 20:00 a few second after open server. 2 Days is 48h. Now 24.01.2026 I have 17 hours left, so my VIP will expire 08:00 25.01.2026. Where is 12h? SCAM.   2. Where is ivory tower area?   3. When next wipe?   
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..