国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

PAT 1023

2019-11-06 06:06:07
字體:
來源:轉載
供稿:網友
#include<cstdio>#include<iostream>#include<string>#include<string.h>#include<algorithm>#include<queue>#include<map>#include<set>#include<cmath>using namespace std;struct bign{	int d[22];	int len;	bign()	{		memset(d,0,sizeof(d));		len=0;	}};string str1,str2;bign _double(bign a){	bign c;	int carry=0;	for(int i=0;i<str1.length();i++)	{			int temp=a.d[i]+a.d[i]+carry;		carry=temp/10;		c.d[c.len++]=temp%10;	}	if(carry!=0) 		c.d[c.len++]=carry;	if(c.len-1>1&&c.d[c.len-1]==0)		c.len--;	return c;}void PRint(bign a){	for(int i=0;i<a.len;i++)	{		printf("%d",a.d[a.len-1-i]);	}}int main(){	bign a;	//freopen("input.txt","r",stdin);	cin>>str1;	for(int i=0;i<str1.length();i++)	{		a.d[i]=str1[str1.length()-1-i]-'0';	}	bign b=_double(a);	int hash1[10]={0};	int hash2[10]={0};	bool flag=false;	if(b.len!=str1.length())	{		printf("No/n");		print(b);	}	else	{		for(int i=0;i<str1.length();i++)		{			hash1[str1[i]-'0']++;			hash2[b.d[i]]++;		}		for(int i=0;i<10;i++)		{			if(hash1[i]!=hash2[i])			{				flag=true;			}		}		if(flag==true)		{			printf("No/n");			print(b);		}		else		{			printf("Yes/n");			print(b);		}	}	//freopen("con","r",stdin);	system("pause");	return 0;}
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 开鲁县| 博客| 云阳县| 南皮县| 宁南县| 仲巴县| 贵港市| 化隆| 棋牌| 醴陵市| 奈曼旗| 金山区| 新沂市| 丹阳市| 长沙县| 长葛市| 玉溪市| 石泉县| 汶川县| 南宁市| 马山县| 嘉定区| 海城市| 五原县| 衡阳县| 民丰县| 资溪县| 昆明市| 中阳县| 宣武区| 黄山市| 安陆市| 阿合奇县| 丹寨县| 金昌市| 临武县| 潜山县| 镇赉县| 罗甸县| 武强县| 南漳县|