例把
string[] str=new string[]{1,2,3,4}
转换为int[] str=new int[]{1,2,3,4}????
string[] str=new string[]{1,2,3,4}
转换为int[] str=new int[]{1,2,3,4}????
解决方案 »
- asp.net回车触法command命令
- 菜鸟求助
- 对数据库操作时OleDbParameter 有什么好处和坏处
- 请专家来帮忙啊,很急的问题,关于母版页的
- 再发一次。望高手帮忙啊。
- 英雄们啊!!谁帮我解决这个问题,我顶他一年的贴!两天啦!我还是无法解决!
- ●●●●Microsoft HTML Help制作帮助文件的时候只能一个文件一个文件的添加,制作关键词的时候也不支持文件夹功能,真不爽,有没有更爽
- UltraWebGrid 中的UpdateCell事件是否只响应字符或字符串型的CELL呢?
- 怎样使datagrid中一栏文字在一行显示完?
- 安装VS。NET出现的错误??
- 单用户登录的实现问题
- asp.net ajax版本问题ProgressControl
string[] str=new string[]{“1”,“2”,“3”,“4”}
输入法不对,不过也就是这个意思
string[] str = new string[] { "1", "2", "3", "4" };
int[] a = new int[str.Length];
for (int i = 0; i < str.Length; i++)
{
a[i] = int.Parse(str[i]);
}
using System;
using System.Collections.Generic;
using System.Text;namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{ string[] str = new string[4]; int[] s = new int[4]; Console.WriteLine("请输入四个字符串"); for (int i = 0; i < str.Length; i++)
str [i]= Console.ReadLine(); for (int i = 0; i < str.Length; i++)
s[i] = Convert.ToInt32(str[i]); int a=0;
for (int i = 0; i < str.Length; i++)
a += s[i];
Console.WriteLine("a={0}" , a);
}
}
}