题解 | #珠宝店#

珠宝店

https://ac.nowcoder.com/acm/problem/14347

#include<math.h>
int a[10];
int fun(char str[])
{
	int i;
	int count=0;
	for(i=0;str[i]!='\0';i++)
	{
		count+=str[i]-64;
	}
	return count;
}
int main()
{
	int i=0,count=0,n;
	char str[10];
	scanf("%d",&n);
	while(i<n)
	{
		scanf("%s",str);
		getchar();
		a[i]=fun(str);
		i++;
	}
	for(count=0;count<i;count++)
	{
		printf("%d\n",a[count]);
	}
}
全部评论

相关推荐

陆续:不可思议 竟然没那就话 那就我来吧 :你是我在牛客见到的最美的女孩
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务