1051: 手机(MOBILE)
#include <iostream>
#include <iomanip>
#include <cstdlib>
#include <string>
using namespace std;
int main(){
char s;
int k = ;
int count = ;
//for(int i=0 ; i < s.length(); i++)
while(s = cin.get())
{
// k++;
// if(k>200)
// break;
if(s == '\n')
break;
switch(s)
{
case 'a':
case 'd':
case 'g':
case 'j':
case 'm':
case 'p':
case 't':
case 'w':
case ' ':
count+= ;
break;
case 'b':
case 'e':
case 'h':
case 'k':
case 'n':
case 'q':
case 'u':
case 'x':
count += ;
break; case 'c':
case 'f':
case 'i':
case 'l':
case 'o':
case 'r':
case 'v':
case 'y':
count += ;
break;
case 's':
case 'z':
count += ;
break;
}
}
cout<<count<<endl; // cout<<setiosflags(ios::fixed)<<setprecision(4)<<s<<endl;
// cout<< setiosflags(ios::fixed)<<setprecision(4) <<c<<endl;
}
http://oj.lcsyzx.cn/JudgeOnline/problem.php?id=1051
#include<iostream>
#include<string>
using namespace std;
int num[]={,,,,,,,,,,,,,,,,,,,,,,,,,};
int x;
string s;
int main(){
getline(cin,s);
for(int i=;i<s.size();i++)x+=s[i]==' '?:num[s[i]-'a'];
cout<<x<<endl;
return ;
}
1051: 手机(MOBILE)的更多相关文章
- JavaScript判断是否是手机mobile登录
在页面代码中加入以下js,即可利用JavaScript判断是否是手机mobile登录! <script type="text/javascript" src="${ ...
- javascript判断设备类型-手机(mobile)、安卓(android)、电脑(pc)、其他(ipad/iPod/Windows)等
使用device.js检测设备并实现不同设备展示不同网页 html代码: <!doctype html> <html> <head> <meta charse ...
- 使用 Nginx 内置 $http_user_agent 来区分( 电脑 pc、手机 mobile、平板 pad )端的内容访问
location / { #pc端内容访问 set $flag "pc"; set $num 1; set $hua "${http_user_agent}"; ...
- 分享一个检测用户是否用手机(Mobile)访问网站的 PHP 类
有一个基于MIT License协议开源的PHP程序 http://code.google.com/p/php-mobile-detect/ 程序就是一个文件,下载之后直接引用就可以. 使用方法: & ...
- js判断是电脑(pc)访问还是手机(mobile)访问
<script> if ((navigator.userAgent.match(/(iPhone|iPod|Android|ios|iOS|iPad|Backerry|WebOS|Symb ...
- [mobile]监听手机mobile上面软键盘的回车[enter]事件
$(document).keypress(function(e) { if(e.which == 13) { if(!$(".qaSearchInput").val()) { Hn ...
- 移动应用(手机应用)开发IM聊天程序解决方案
这个解决方法已经定制下来很久了,上一段时间比较忙,没有时间整这些东西.最近稍微好些,不怎么加班.所以抽空总结下,同时也分享给大家,也算是给大家一个借鉴吧!或许这并不是最好的解决方案,但只要能满足当前需 ...
- jQuery支持mobile的全屏水平横向翻页效果
这是一款支持移动手机mobile设备的jQuery全屏水平横向翻页效果插件. 该翻页插件能够使页面在水平方向上左右全屏翻动,它支持手机触摸屏,支持使用鼠标滚动页面. 整个页面过渡平滑,效果很不错. 在 ...
- 使用JavaScript调用手机平台上的原生API
我之前曾经写过一篇文章使用Cordova将您的前端JavaScript应用打包成手机原生应用,介绍了如何使用Cordova框架将您的用JavaScript和HTML开发的前端应用打包成某个手机平台(比 ...
随机推荐
- dotnetty 心跳
IdleStateHandler 需要提供三个参数: readerIdleTimeSeconds, 读超时. 即当在指定的事件间隔内没有从 Channel 读取到数据时, 会触发一个 READER_I ...
- 用jquery实现的QQ邮箱里的多收件人选取及其他效果改进版
我们先来看一下之前网上的版本效果: 发现很多bug且应用场景不一样,没办法只能自己写了 操作时 textarea 的值只是显示效果,实现的参数为 hidden 2017-04-25再次改进版与新版的 ...
- 副总统第一至三季/全集Veep迅雷下载
本季第一.二.三季 Veep Season 1 (2012-2014)看点:<副总统>讲述了Selina Meyer从一名参议员成为副总统后,开始面对成堆的突发状况,很快,她便认识到,成为 ...
- 3分钟搞定SpringBoot+Mybatis+druid多数据源和分布式事务
文章来自: https://blog.csdn.net/qq_29242877/article/details/79033287 在一些复杂的应用开发中,一个应用可能会涉及到连接多个数据源,所谓多数据 ...
- Failed to register: Error: fabric-ca request register failed with errors [[{"code":0,"message":"No identity type provided. Please provide identity type"}]]解决方案
I try to run sample application as stated here : http://hyperledger-fabric.readthedocs.io/en/release ...
- Remote Desktop Session中如何触发Ctrl+Alt+Delete?
Ctrl+Alt+End is a keyboard shortcut used in a Remote Desktop Session to display the security dialog ...
- Android 第三方加固方案 对比 MD
常见的第三方加固方案官网介绍 由于安卓APP是基于Java的,所以极容易被破解,一个不经过加固的APP犹如裸奔一样,毫无防备.之前曾有新闻报道,一些专职的APP打包黑产就是专门从各种渠道找到apk,通 ...
- random_state 参数
SVC(random_state=0)里有参数 random_state random_state 相当于随机数种子,下面会有代码来解释其作用.图中设置了 random.seed() 就相当于在 SV ...
- 多维数组分解----SVD在推荐系统中的应用-
http://www.janscon.com/multiarray/rs_used_svd.html [声明]本文主要参考自论文<A SINGULAR VALUE DECOMPOSITION A ...
- 【转】字符编码笔记:ASCII,Unicode 和 UTF-8
原文:http://www.ruanyifeng.com/blog/2007/10/ascii_unicode_and_utf-8.html https://www.key-shortcut.com/ ...