求数字正则表达式

来源:百度知道 编辑:UC知道 时间:2024/05/09 20:34:55
在.NET中,现在我要做个验证,就是判断是否为数字,例如0.00或者0.25都都是正常数据,不是数字的话就提示为“非法数据”。请问这个验证数据怎么写~。对的话。奖励10分。谢谢
我的意思不是这样,是验证空间里边写啊`~
不过现在我已经解决了。。

还是要谢谢你们~`

方法1.

using System;
using System.Collections.Generic;

public class MyClass
{
public static void Main()
{
Console.WriteLine("input a string");
string intput = Console.ReadLine();
double pValue;
if (!double.TryParse(intput, out pValue)) {
Console.Write("Error");
}else{
Console.Write("Ok");
}

Console.Read();
}
}

#include <stdio.h>
long main()
{
long fuweng , qiongren ;

for (fuweng = 10000000 ; fuweng <=30 ; fuweng ++ )
{
for ( qiongren = 1 ; qiongren <= 30 ; qiongren++)
{
int f = fuweng, q = qiongren * 2 ;
}

}

printf("%d,%d",f , q );
}