第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

C#開發(fā)輕松入門

難度入門
時(shí)長(zhǎng) 4小時(shí)43分
學(xué)習(xí)人數(shù)
綜合評(píng)分9.40
833人評(píng)價(jià) 查看評(píng)價(jià)
9.5 內(nèi)容實(shí)用
9.5 簡(jiǎn)潔易懂
9.2 邏輯清晰
  • 命名空間中有若干個(gè)類

    查看全部
  • for (int i = 1; i <= 7; i++)

    {

    ????for (int j = 1; j <= 7; j++)

    ????{

    ????????Console.Write(i ==j || i + j == 8 ? 'O' : '.');

    ????}

    ????Console.WriteLine();

    }

    查看全部
    0 采集 收起 來(lái)源:編程練習(xí)

    2022-06-26

  • 10.各位相加

    給定一個(gè)非負(fù)整數(shù) num,反復(fù)將各個(gè)位上的數(shù)字相加,直到結(jié)果為一位數(shù)。返回這個(gè)結(jié)果。

    輸入樣例1:

    在這里給出一組輸入。例如:

    38

    輸出樣例1:

    在這里給出相應(yīng)的輸出。例如:

    2

    解釋樣例2:

    數(shù)字38各位相加的過(guò)程為:
    38 --> 3 + 8 --> 11
    11 --> 1 + 1 --> 2
    由于 2 是一位數(shù),所以返回 2。

    輸入樣例2:

    在這里給出一組輸入。例如:

    0

    輸出樣例2:

    在這里給出相應(yīng)的輸出。例如:

    0

    using System;


    class Program

    {

    ? ? static void Main()

    ? ? {

    ? ? ? ? int n = Convert.ToInt16(Console.ReadLine());

    ? ? ? ??

    ? ? ? ? while(n > 9)

    ? ? ? ? {

    ? ? ? ? ? ? int sum = 0;

    ? ? ? ? ? ? while(n != 0)

    ? ? ? ? ? ? {

    ? ? ? ? ? ? ? ? sum += n % 10;

    ? ? ? ? ? ? ? ? n /= 10;

    ? ? ? ? ? ? }

    ? ? ? ? ? ? n = sum;

    ? ? ? ? }


    ? ? ? ? Console.WriteLine(n);

    ? ? }

    ? ??

    }

    查看全部
    0 采集 收起 來(lái)源:練習(xí)題目

    2022-06-24

  • 8.尋找數(shù)組中的最小值

    尋找數(shù)組中最小值
    注意:

    數(shù)組中元素并不一定是整數(shù)

    輸入格式:

    第一行輸入為數(shù)組元素的個(gè)數(shù),假設(shè)為n
    第二行輸入為數(shù)組中的第一個(gè)元素
    ...
    第N輸入為數(shù)組的最后一個(gè)元素

    輸出格式:

    輸出數(shù)組中的最小值

    using System;

    using System.Collections.Generic;

    using System.Linq;

    using System.Text;

    using System.Threading.Tasks;


    namespace ConsoleApplication1

    {

    ? ? class Program

    ? ? {

    ? ? ? ? static void Main(string[] args)

    ? ? ? ? {

    ? ? ? ? ? ? int num = Convert.ToInt32(Console.ReadLine());

    ? ? ? ? ? ? double[] arr = new double[num];

    ? ? ? ? ? ? double min = arr[0];

    ? ? ? ? ? ? for (int i = 0; i < arr.Length; i++)

    ? ? ? ? ? ? {

    ? ? ? ? ? ? ? ? arr[i] = double.Parse(Console.ReadLine());

    ? ? ? ? ? ? ? ? if (arr[i] < min)

    ? ? ? ? ? ? ? ? ? ? min = arr[i];

    ? ? ? ? ? ? }

    ? ? ? ? ? ? Console.WriteLine(min);

    ? ? ? ? }

    ? ? }

    }

    查看全部
    0 采集 收起 來(lái)源:練習(xí)題目

    2022-06-24

  • 7.尋找數(shù)組中的最大值

    尋找數(shù)組中最大值
    注意:

    數(shù)組中元素并不一定是整數(shù)

    輸入格式:

    第一行輸入為數(shù)組元素的個(gè)數(shù),假設(shè)為n
    第二行輸入為數(shù)組中的第一個(gè)元素
    ...
    第N輸入為數(shù)組的最后一個(gè)元素

    輸出格式:

    輸出數(shù)組中的最大值

    using System;


    class Program

    {

    ? ? static void Main()

    ? ? {

    ? ? ? ? int n = Convert.ToInt16(Console.ReadLine());

    ? ? ? ? double max = -0x3f3f3f3f;


    ? ? ? ? for(int i = 0; i < n; ++i)

    ? ? ? ? {

    ? ? ? ? ? ? double tmp = Convert.ToDouble(Console.ReadLine());

    ? ? ? ? ? ? if(tmp > max)

    ? ? ? ? ? ? {

    ? ? ? ? ? ? ? ? max = tmp;

    ? ? ? ? ? ? }

    ? ? ? ? }


    ? ? ? ? Console.WriteLine(max);

    ? ? }

    ? ??

    }

    查看全部
    0 采集 收起 來(lái)源:練習(xí)題目

    2022-06-24

  • 6.計(jì)算整數(shù)n到整數(shù)m之間數(shù)的總和

    計(jì)算整數(shù)n到整數(shù)m之間數(shù)的總和

    輸入格式:

    第一行輸入整數(shù)n
    第二行輸入整數(shù)m

    輸出格式:

    輸出和

    using System;


    class Program

    {

    ? ? static void Main()

    ? ? {

    ? ? ? ? int n = Convert.ToInt16(Console.ReadLine());

    ? ? ? ? int m = Convert.ToInt16(Console.ReadLine());


    ? ? ? ? int sum = 0;

    ? ? ? ? for(int i = n; i <= m; ++i)

    ? ? ? ? {

    ? ? ? ? ? ? ? ? sum += i;

    ? ? ? ? }


    ? ? ? ? Console.WriteLine(sum);

    ? ? }

    ? ??

    }


    查看全部
    0 采集 收起 來(lái)源:練習(xí)題目

    2022-06-24

  • 5.求解分段函數(shù)

    編寫程序,求解如下分段函數(shù):

    當(dāng)x≤0時(shí)f(x)=x2+2

    當(dāng)x>0時(shí)f(x)=x+3

    注意:

    x為整數(shù)

    輸入格式:

    輸入為x

    輸出格式:

    輸出為f(x)

    using System;

    using System.Collections.Generic;

    using System.Linq;

    using System.Text;

    using System.Threading.Tasks;


    namespace ConsoleApp1

    {

    ? ? internal class Program

    ? ? {

    ? ? ? ? static void Main(string[] args)

    ? ? ? ? {

    ? ? ? ? ? ? double x;

    ? ? ? ? ? ? x = Convert.ToDouble(Console.ReadLine());

    ? ? ? ? ? ? if (x <= 0)

    ? ? ? ? ? ? {

    ? ? ? ? ? ? ? ? Console.WriteLine(x*x+2);

    ? ? ? ? ? ? }

    ? ? ? ? ? ? else

    ? ? ? ? ? ? {

    ? ? ? ? ? ? ? ? Console.WriteLine(x+3);

    ? ? ? ? ? ? }

    ? ? ? ? }

    ? ? }

    }

    查看全部
    0 采集 收起 來(lái)源:練習(xí)題目

    2022-06-24

  • 4.查詢成績(jī)

    輸入一個(gè)成績(jī):

    如果成績(jī)大于等于60,則輸出恭喜您,您通過(guò)了這次考試!

    否則輸出非常抱歉,您沒有通過(guò)此次考試!。

    注意:

    成績(jī)都為整數(shù)

    標(biāo)點(diǎn)符號(hào)為中文標(biāo)點(diǎn)符號(hào)

    using System;

    using System.Collections.Generic;

    using System.Linq;

    using System.Text;

    using System.Threading.Tasks;


    namespace ConsoleApplication1

    {

    ? ? class Program

    ? ? {

    ? ? ? ? static void Main(string[] args)

    ? ? ? ? {

    ? ? ? ? ? ? float cj;

    ? ? ? ? ? ? cj = Convert.ToSingle(Console.ReadLine());

    ? ? ? ? ? ? if (cj >= 60)

    ? ? ? ? ? ? {

    ? ? ? ? ? ? ? ? Console.WriteLine("恭喜您,您通過(guò)了這次考試!");

    ? ? ? ? ? ? }

    ? ? ? ? ? ? else?

    ? ? ? ? ? ? {

    ? ? ? ? ? ? ? ? Console.WriteLine("非常抱歉,您沒有通過(guò)此次考試!");

    ? ? ? ? ? ? }

    ? ? ? ? ? ??

    ? ? ? ? }

    ? ? }

    }


    查看全部
    0 采集 收起 來(lái)源:練習(xí)題目

    2022-06-24

  • 3.統(tǒng)計(jì)字符串中指定字符的數(shù)量

    統(tǒng)計(jì)字符串中指定字符的數(shù)量

    輸入格式:

    第一行輸入給定字符串
    第二行輸入給定字符

    輸出格式:

    輸出待統(tǒng)計(jì)字符個(gè)數(shù)

    using System;

    using System.Collections.Generic;

    using System.Linq;

    using System.Text;

    using System.Threading.Tasks;


    namespace ConsoleApp1

    {

    ? ? internal class Program

    ? ? {

    ? ? ? ? static void Main(string[] args)

    ? ? ? ? {

    ? ? ? ? ? ? string str;

    ? ? ? ? ? ? str = Console.ReadLine();

    ? ? ? ? ? ? int count = 0;

    ? ? ? ? ? ? char y;

    ? ? ? ? ? ? y = Convert.ToChar(Console.ReadLine());

    ? ? ? ? ? ? for(int i = 0; i < str.Length; ++i)

    ? ? ? ? ? ? {

    ? ? ? ? ? ? ? ? if (str[i] == y)

    ? ? ? ? ? ? ? ? {

    ? ? ? ? ? ? ? ? ? ? ++count;

    ? ? ? ? ? ? ? ? }

    ? ? ? ? ? ? }

    ? ? ? ? ? ? Console.WriteLine(count);

    ? ? ? ? }

    ? ? }

    }

    查看全部
    0 采集 收起 來(lái)源:練習(xí)題目

    2022-06-24

  • 2.求解互補(bǔ)數(shù)

    請(qǐng)編寫程序求解輸入數(shù)據(jù)的互補(bǔ)數(shù),如果輸入數(shù)據(jù)小于0則打印字符串輸入數(shù)據(jù)不合法。互補(bǔ)數(shù)定義如下:

    兩個(gè)個(gè)位數(shù)(正整數(shù))相加和為10的一對(duì)數(shù),稱為互補(bǔ)數(shù)

    例如?: 1的互補(bǔ)數(shù)是9。

    using System;

    using System.Collections.Generic;

    using System.Linq;

    using System.Text;

    using System.Threading.Tasks;


    namespace ConsoleApplication1

    {

    ? ? class Program

    ? ? {

    ? ? ? ? static void Main(string[] args)

    ? ? ? ? {

    ? ? ? ? ? ? int a = Convert.ToInt32(Console.ReadLine());

    ? ? ? ? ? ? if (a < 0)

    ? ? ? ? ? ? {

    ? ? ? ? ? ? ? ? Console.WriteLine("輸入數(shù)據(jù)不合法");

    ? ? ? ? ? ? }

    ? ? ? ? ? ? else

    ? ? ? ? ? ? {

    ? ? ? ? ? ? ? ? Console.WriteLine("{0}", 10 - a);

    ? ? ? ? ? ? }

    ? ? ? ? }

    ? ? }

    }

    查看全部
    0 采集 收起 來(lái)源:練習(xí)題目

    2022-06-24

  • 1.統(tǒng)計(jì)n到m之間能被s整除的數(shù)的總和

    統(tǒng)計(jì)n到m之間(包括m)能被s整除的數(shù)的總和

    輸入格式:

    第一行輸入n,如1
    第二行輸入m,如100
    第三行輸入s,如3

    輸出格式:

    輸出結(jié)果,如1683

    using System;


    class Program

    {

    ? ? static void Main()

    ? ? {

    ? ? ? ? int n = Convert.ToInt16(Console.ReadLine());

    ? ? ? ? int m = Convert.ToInt16(Console.ReadLine());

    ? ? ? ? int s = Convert.ToInt16(Console.ReadLine());


    ? ? ? ? int sum = 0;

    ? ? ? ? for(int i = n; i <= m; ++i)

    ? ? ? ? {

    ? ? ? ? ? ? if(i % s == 0)

    ? ? ? ? ? ? {

    ? ? ? ? ? ? ? ? sum += i;

    ? ? ? ? ? ? }

    ? ? ? ? }


    ? ? ? ? Console.WriteLine(sum);

    ? ? }

    ? ??

    }

    查看全部
    0 采集 收起 來(lái)源:練習(xí)題目

    2022-06-24

  • for (int x = 1; x < 10; x++)

    ? ? ? ? ? ? {

    ? ? ? ? ? ? ? ?if (x==3||x==8)

    ? ? ? ? ? ? ? ?continue;//請(qǐng)?zhí)砑哟a,過(guò)濾3和8

    ? ? ? ? ? ? ? ? Console.Write(x);

    查看全部
  • C#中的switch,每個(gè)分支都應(yīng)該以break;結(jié)束,break的作用是跳出switch結(jié)構(gòu)。但是,如果某個(gè)分支中沒有語(yǔ)句,那么也可以不寫break;

    查看全部
    0 采集 收起 來(lái)源:練習(xí)題

    2022-05-25

  • switch?中的(變量)只能是3種類型:整型(如?int?)、字符型(?char?)、字符串類型(?string?)。

    查看全部
  • while循環(huán)

    先判斷循環(huán)條件,若條件為?true?,就執(zhí)行循環(huán)體一次,然后再判斷條件...當(dāng)條件為?false?時(shí),結(jié)束循環(huán)。

    查看全部

舉報(bào)

0/150
提交
取消
課程須知
本課程是C#基礎(chǔ)課程,熱烈歡迎各位小伙伴拍磚吐槽!!
老師告訴你能學(xué)到什么?
1、C#的基本概念 2、Visual Studio的使用技巧 3、C#的語(yǔ)法和程序邏輯

微信掃碼,參與3人拼團(tuán)

微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)

友情提示:

您好,此課程屬于遷移課程,您已購(gòu)買該課程,無(wú)需重復(fù)購(gòu)買,感謝您對(duì)慕課網(wǎng)的支持!