using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Review
{
class Program
{
static void Main(string[] args)
{
#region 通过程序计算1+2-3+4-5+6-7...+98-99+100;
//int sum = 0;
//for (int i = 1; i <= 100; i++)
//{
// //i=1和i为偶数的情况下相加
// if (i == 1 || i % 2 == 0)
// {
// sum += i;
// }
// else
C#练习——字符串字符个数,简单数学题
最新推荐文章于 2025-01-04 19:45:49 发布
本文展示了两个C#编程练习,第一个计算1到100的交替求和,第二个让用户输入字符串并输出其字符个数。通过这两个实例,探讨了循环结构和字符串Length属性的应用。

最低0.47元/天 解锁文章

1719

被折叠的 条评论
为什么被折叠?



