Execute
Save
Share
Share link
share
share
share
Team
Public Teams
Comments
0
Created By:
Guest
Title:
Title
Description
Edit
Copy Link
Login
Email *
Password *
Login
OR
Create Account
Screen Name *
Email *
Password *
Retype Password *
Team Access Code
Register
Public CodeBins
HELP
--Select Theme--
Ambiance
Blackboard
Cobalt
Eclipse
Elegant
Erlang-Dark
Lesser-Dark
Monokai
Neat
Night
Rubyblue
Vibrant-Ink
Xq-Dark
New CodeBin
CodeBins Versions
09/08/2019- V.1
Recent CodeBins
View All CodeBins
//Deepanjali Singh #include < iostream > #include < bits / stdc++.h > using namespace std; int countrycodes(string s) { int count = 0; int n = s.length(); char char_array[n + 1]; strcpy(char_array, s.c_str()); for (int i = 0; i < n - 1; i++) { //search for (int j = i + 2; j < n - 1; j++) { if (char_array[i] == char_array[j]) { //int a; if (char_array[i + 1] == char_array[j + 1]) count = count + 1; } } } return n - count - 1; } int main() { // int input=3; //char string[input][100]={"INBY","BYBY","HELLO"}; int input; cin >> input; string str; if (input > 0) { for (int k = 0; k < input; k++) { cin >> str; //} // for(int i=0;i<input;i++){ int a; a = countrycodes(str); cout << a << "\n"; } } else { cout << "Invalid number of input strings"; } // your code goes here return 0; }
Bottom of Page
In Head
On Load
On Ready
Setting
Validate
Copy
Format
/****************************************************************************** Online C Compiler. Code, Compile, Run and Debug C program online. Write your code in this editor and press "Run" button to compile and execute it. *******************************************************************************/ #include <stdio.h> #include<math.h> int checksqare(int); int prime(int); int factor(int); int main() { int n; printf("\nEnter the number of cupcakes:"); scanf("%d",&n); checksquare(n); return 0; } int checksquare(int x) { int ivar; float fvar; fvar=sqrt((x)); ivar=fvar; if(fvar==ivar) printf("0"); else prime(x); return 0; } int prime(int x) { int i,p=0; for(i=1; i<=x; i++) { if(x%i==0) { p++; } } if(p==2) printf("1"); else factor(x); return 0; } int factor(int x) { int i return 0; }
Setting
Validate
Copy
Format
No Doc Type
HTML5
HTML 4.01 Transitional
HTML 4.01 Strict
HTML 4.01 Frameset
XHTML 1.1
XHTML 1.0 Transitional
XHTML 1.0 Strict
XHTML 1.0 Frameset
Copy
Format
Download
×
Code Description
×
Difference of Versions
HTML
CSS
JS
×
JS Error
×
CSS Error
Errors
Warnings
×
JavaScript Setting
JS Libraries:
Chrome Frame 1.0.3
Dojo 1.8.0
Dojo 1.7.3
Dojo 1.7.2
Ext Core 3.1.0
jQuery 1.8.0
jQuery 1.7.2
jQuery 1.6.0
jQuery 1.5.0
jQuery 1.4.4
jQuery 1.4.0
jQuery-min 1.7.2
jQueryUI-min 1.8.21
MooTools more-1.4.0.1-full
MooTools core-1.4.5-full
MooTools core-1.4.1-full
Prototype 1.7.1.0
script.aculo.us 1.9.0
SWFObject 2.2
Twitter Bootstrap 2.0.4
WebFont Loader 1.0.28
yui 3.5.1
User Libraries:
Upload File
JavaScript URL(s):
×
CSS Setting
CSS Libraries:
jQueryUI 1.8.21
Twitter Bootstrap 2.0.4
User Libraries:
Upload File
CSS URL(s):