zoukankan      html  css  js  c++  java
  • A1005 Spell It Right

    在这里插入图片描述

    #include<iostream>
    #include<vector>
    #include<queue>
    #include<stack>
    #include<string>
    #include<math.h>
    #include<algorithm>
    #include<map>
    #include<cstring>
    #include<set>
    using namespace std;
    string a[10] = { "zero","one","two","three","four","five","six","seven","eight","nine" };
    int main()
    {
    	string s; cin >> s;
    	int sum = 0;
    	for (int i = 0; i < s.length(); i++)
    	{
    		sum += (s[i] - '0');
    	}
    	string b= to_string(sum);
    	for (int i = 0; i < b.size(); i++)
    	{
    		cout << a[b[i] - '0'];
    		if (i < b.size() - 1)
    		{
    			cout << " ";
    		}
    	}
    }
    
  • 相关阅读:
    hdu 1074
    hdu 4091
    hdu 4422
    hdu 3940
    hdu 2831
    hdu 1172
    hdu 3732
    hdu 1250
    hud 2073
    IOS socket基于tcp/udp的通信
  • 原文地址:https://www.cnblogs.com/Hsiung123/p/13811986.html
Copyright © 2011-2022 走看看