It feels like nobody ever know me till you know me
Feels like nobody ever loved me till you loved me
Feels like nobody ever touched me till you touched me
Baby,nobody,nobody,nobody,nobody,until you
--Shayne Ward《Until You》
Experiment_1:
【描述】熟悉VS2010开发环境,熟悉各个窗口。
略。
Experiment_2:
【描述】一数列的规则如下:1,1,2,3,5,8,13,21,34......求第30位数是多少?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Experiment_1_01
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("The number is :");
int a = 1, b = 1, c=0;
for(int i=3;i<31;i++){
c=a+b;
a = b;
b = c;
}
Console.WriteLine(c);
}
}
}
Experiment_3:
【描述】输入一个年份,判断是否为闰年(被4整除,且不被100整除,或者被400整除)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Experiment_1_02
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Please input your year:");
string s=Console.ReadLine();
int y = int.Parse(s);
if (y % 4 == 0 || y % 400 == 0 && y % 100 != 0)
Console.WriteLine("{0}is LeapYear", y);
else
Console.WriteLine("{0}is not LeapYear", y);
}
}
}
Experiment_4:
【描述】一青年歌手参加比赛,有10位评委打分,(分值只能为正整数数字),计算并输出歌手的平均分(去掉一个组高分和一个最低分)。平均分以double数据类型输出。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Experiment_1_03
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Please input your ten numbers:");
string[] a = Console.ReadLine().Split(' ');
int sum=0;
int max=-10,min=1000;
for(int i=0;i<10;i++){
int b=int.Parse(a[i]);
if (max < b)
{
max = b;
}
if (min > b)
{
min = b;
}
sum += b;
}
double average;
average=(sum-max-min)/8.0; //please pay your attention
Console.WriteLine(average);
}
}
}
Experiment_5:
【描述】输入一个字符串,判断该字符串是否为“回文”(即顺读和逆读相同的字符串)。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Experiment_1_04
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Please input your arrays:");
string s = Console.ReadLine();
char[] c = s.ToCharArray();
bool f = true;
for(int i=0,j=c.Length-1;i<c.Length;i++,j--){
if(i==j||j<i){
break;
}
if(c[i]!=c[j]){
f=false;
break;
}
}
if(f)
Console.WriteLine(s+"是回文字符串");
else
Console.WriteLine(s+"不是回文字符串");
}
}
}