摘要: 整数或者小数:^[0-9]+\.{0,1}[0-9]{0,2}$只能输入数字:"^[0-9]*$"。只能输入n位的数字:"^\d{n}$"。只能输入至少n位的数字:"^\d{n,}$"。只能输入m~n位的数字:。"^\d{m,n}$"只能输入零和非零开头的数字:"^(0|[1-9][0-9]*)$"。只能输入有两位小数的正实数:"^[0-9]+(.[0-9]{2})?$"。只能输入有1~3位小数的正实数:"^[0-9]+(.[0-9]{1,3})?$"。只 阅读全文
posted @ 2014-02-24 21:35 狰狞蛋子 阅读(126) 评论(0) 推荐(0) 编辑
摘要: 1、把字符串中ASCⅡ为奇数,元素下标为偶的删除#include#includevoid fun(char*s,char t[]){int i,j=0,n;n=strlen(s);for(i=0;i#include#includevoid fun (char *str){int i=0;char *p=str;while(*p){if(*p!=''){str[i]=*p;i++;}p++;}str[i]='\0';}main(){char str[81];char Msg[]="Input a stirng";int n;printf(Msg 阅读全文
posted @ 2014-02-24 18:55 狰狞蛋子 阅读(374) 评论(0) 推荐(0) 编辑
摘要: 1、声明主键using System;using System.ComponentModel.DataAnnotations;namespace MvcGuestbook.Models{public class Guestbook{[Key]public int No{get;set;}...}}2、声明必填字段using System;using System.ComponentModel.DataAnnotations;namespace MvcGuestbook.Models{public class Guestbook{[Key]public int No{get;set;}[Requ 阅读全文
posted @ 2014-02-24 18:45 狰狞蛋子 阅读(302) 评论(0) 推荐(0) 编辑