From 7fece3c3aa698ab31350ba729d0973986187d371 Mon Sep 17 00:00:00 2001 From: Kirito <1362050620@qq.com> Date: Wed, 1 Jun 2016 22:52:57 +0800 Subject: [PATCH] Create 1130_vij.cpp --- QUSTOJ/1130_vij.cpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 QUSTOJ/1130_vij.cpp diff --git a/QUSTOJ/1130_vij.cpp b/QUSTOJ/1130_vij.cpp new file mode 100644 index 0000000..0f6e403 --- /dev/null +++ b/QUSTOJ/1130_vij.cpp @@ -0,0 +1,30 @@ +#include +using namespace std; +int main() +{ +char a[100]; +int a1[100],s=0; +for(int i=1;i<=13;i++) +{ +cin>>a[i]; +a1[i]=a[i]-48; +} + +for(int i=1,g=1;i<=11;i++,g++) +{ +if(a[i]=='-')i++; +s+=a1[i]*g; +} + +if(s%11==10&&a[13]=='X'||s%11==a1[13]) cout<<"Right"<