We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e008f26 commit f711fe8Copy full SHA for f711fe8
C++/Checkcode.cpp
@@ -0,0 +1,36 @@
1
+#include<iostream>
2
+#include<bits/stdc++.h>
3
+using namespace std;
4
+int main()
5
+{
6
+ int num1,num2;
7
+ cin>>num1>>num2;
8
+ string code;
9
+ cin>>code;
10
+ if(num1+num2+1!=code.size())
11
+ {
12
+ cout<<"No"<<endl;
13
+ return 0;
14
+ }
15
+ if (code[num1]!='-')
16
17
18
19
20
+ int counter=0;
21
+ for(int i=0;i<code.size();i++)
22
23
+ if(code[i]>=48 && code[i]<=57 && i!=num1)
24
25
+ counter++;
26
27
28
+ if(counter==num1+num2)
29
30
+ cout<<"Yes"<<endl;
31
32
+ else{
33
34
35
36
+}
0 commit comments