L1-062 幸运彩票 (15分)
题目详情:
AC代码:
#include<iostream>
using namespace std;
int main()
{
int n,a,b;
string str;
cin>>n;
for(int i=1;i<=n;i++)
{
cin>>str;
a=str[0]-'0'+str[1]-'0'+str[2]-'0';
b=str[3]-'0'+str[4]-'0'+str[5]-'0';
if(a==b)
cout<<"You are lucky!"<<endl;
else
cout<<"Wish you good luck."<<endl;
}
return 0;
}
永远相信美好🎈