poj 百练2973(基础题)
来源:互联网 发布:托福阅读词汇题 知乎 编辑:程序博客网 时间:2024/05/16 04:38
书上的思路总是那么清晰
代码总是那么优美
#include <fstream>#include <string.h>#include <stdio.h>#define _cdebbug//全局数据int main(){//重定向#ifdef _cdebbugfreopen("F:\\input.txt","r",stdin );#endifint i;char skew[35];int sum,k;int base[31];base[0] = 1;for(i = 1; i < 31; ++i)base[i] = 2 * base[i - 1] + 1;while(1){scanf("%s",skew);if(strcmp(skew,"0") == 0)break;sum = 0;k = strlen(skew);for(i = 0; i < strlen(skew); ++i){k--;sum += (skew[i] - '0') * base[k];}printf("%d\n",sum);}//解除重定向关闭文件#ifdef _cdebbugfclose(stdin); #endifreturn 0 ;}
- poj 百练2973(基础题)
- poj 百练2972(基础题)
- poj 百练2734(基础题)
- poj 百练(2735)基础题
- poj 百练 2798(基础题)
- poj 百练 2742(基础题)
- poj 百练2974(基础题)
- poj 百练2744( 基础题)
- poj 百练2975(基础题)
- poj 百练 2743(基础题)
- poj 百练 2976(基础题)
- poj 百练 2819(基础题)
- poj 百练2820(基础题)
- poj 百练 2797(基础题)
- poj 百练2799(基础题)
- poj 百练 2765(基础题)有难度
- C语言I/O小结 poj百练2804字典(基础题)
- POJ 百练 2973: Skew数
- Android异步处理系列文章索引
- 使用waveOut接口在Windows中播放声音
- VC6中链接access数据库时出现数据被截断的错误解决办法 更新日期:2008年04月18日 来源:本站原创 作者:天漏客 访问次数:311次 【字体:大 中 小】 在VC6中编程连接数据
- 【动态规划】最长递增子序列代码(UVA 10131)
- VIM Plugin Summary
- poj 百练2973(基础题)
- 生成验证码(asp.net)
- 关于@淘宝日照问题的代码
- Steiner tree problem
- 【Html5】canvas绘制圆形
- Oracle事务基本原理
- vim(gvim)相关插件整理
- 8.1
- 面向对象编程的基本知识——类、对象(asp.net)