• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
WuhaYaoShenmeAi
博客园 首页 新随笔 联系 订阅 订阅 管理

2013年6月16日

6.15判断数独
摘要: #include #include #define N 13 int A[N][N]; int tag[10]; bool JudgeRow() { for (int i=1;i<=9;++i) { memset(tag,0,sizeof(int)*10); for (int j=1;j<=9;++j) { tag[A[i][j]]=1; } for (int j=1;j<=9;++j) { if (tag[j]==0) { return false; } } } return true; } bool JudgeC... 阅读全文
posted @ 2013-06-16 16:47 WuhaYaoShenmeAi 阅读(142) 评论(0) 推荐(0)
 
6.15奇特大数加法
摘要: 、代码如下:#include #include int buf[6]={0,2,3,5,7,11}; void Swap(char &a,char &b) { char c=a; a=b; b=c; } void ReverseString(char *s) { int i=0; int j=strlen(s)-1; while (i=10) CC[lenCC++]='A'; else CC[lenCC++]=tmp2+'0'; step++; } while (i=10) CC[lenCC++]='A'; else CC[len 阅读全文
posted @ 2013-06-16 16:45 WuhaYaoShenmeAi 阅读(102) 评论(0) 推荐(0)
 
6.15大数加法(十进制和十六进制)
摘要: #include #include void Swap(char &a,char &b) { char t = a; a =b; b = t; } void ReverseString(char *s) { int i=0; int j= strlen(s)-1; while (i #include void Swap(char &a,char &b) { char t = a; a =b; b = t; } void ReverseString(char *s) { int i=0; int j= strlen(s)-1; while (i='A 阅读全文
posted @ 2013-06-16 16:43 WuhaYaoShenmeAi 阅读(245) 评论(0) 推荐(0)
 
2013.6.15 ISBN编号
摘要: #include char str[20]; int main() { int sum; int end; while (scanf("%s",str)==1) { sum=0; sum+=((str[0]-'0')*1); sum+=((str[2]-'0')*2); sum+=((str[3]-'0')*3); sum+=((str[4]-'0')*4); sum+=((str[6]-'0')*5); sum+=((str[7]-'0')*6); sum+=((str[8]- 阅读全文
posted @ 2013-06-16 16:41 WuhaYaoShenmeAi 阅读(104) 评论(0) 推荐(0)
 
2013.6.15吃果子问题
摘要: 问题描述如下:代码 :#include #define N 300 int A[N]; int main() { int n,m; int step,pos; //记录第几步,当前位置 int count; //当前果子数目; int tag; //记录当前吃掉的果子 int lastPos; bool flag; while (scanf("%d%d",&n,&m)==2) { for (int i=1;icount) { if (pos==lastPos) { //printf("-1\n"); fl... 阅读全文
posted @ 2013-06-16 16:40 WuhaYaoShenmeAi 阅读(95) 评论(0) 推荐(0)
 
2013.06.14刘汝佳白书例题3-3-竖式计算
摘要: #include #include int main() { char str[20]; char ss[100]; int count=0; scanf("%s",str); int abc,de,x,y,z; for (abc=111;abc\n",++count); printf("%5d\nX%4d\n",abc,de); printf("-----\n%5d\n%4d\n%5d\n",x,y,z); } } } } 阅读全文
posted @ 2013-06-16 16:37 WuhaYaoShenmeAi 阅读(176) 评论(0) 推荐(0)
 
2013.6.14蛇形矩阵
摘要: #include #include using namespace std; #define MAX 100 int A[MAX][MAX]; void printMatrix(int n) { memset(A,0,sizeof(int)*MAX*MAX); int sum=0; A[0][0]=++sum; int i=0,j=0; while(sum0 && A[i][j-1]==0) { A[i][--j]=++sum; } while(i>0 && A[i-1][j]==0) { A[--i][j]=++sum; } } for... 阅读全文
posted @ 2013-06-16 16:36 WuhaYaoShenmeAi 阅读(113) 评论(0) 推荐(0)
 
 

公告


博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3