1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
kakasveta [241]
4 years ago
12

Use C++ promming language

Computers and Technology
1 answer:
Alecsey [184]4 years ago
6 0

Answer:

C++ CODE:

Explanation:

#include <bits/stdc++.h>

using namespace std;

int countSubstringWithEqualEnds(string s)

{

int result = 0;

int n = s.length();

// Iterating through all substrings in

// way so that we can find first and last

// character easily

for (int i=0; i<n; i++)

for (int j=i+1; j<n; j++)

if (s[i] == s[j]) {

if(s[i] == 'A' || s[i] == 'T'){

result++;

for(int k=i;k<=j;k++){

cout << s[k];

}

cout << endl;

}

}

// result++;

return result;

}

// Driver function

int main()

{

string s;

cin >> s;

cout << "Total DFA matched strings::"<< countSubstringWithEqualEnds(s);

return 0;

}

***********************************************************************************************

OUTPUT:

You might be interested in
Microprocessor is what​
g100num [7]

Answer:

A microprocessor is a computer processor where the data and control is included in a single integrated circuit

Explanation:

7 0
3 years ago
During slideshow mode hitting the b key will do which of these
Lemur [1.5K]
<span>If it's an multiple answer question it's....


</span><span>B.) Blank the screen with black screen (or return to the slide if you are currently blank).</span>
8 0
3 years ago
How does the speaker feel about traditional forms of poetry
Salsk061 [2.6K]
A speaker sometimes is not able to capture the intended details since it is affected by homophones.
7 0
4 years ago
Read 2 more answers
There are 12 inches in a foot and 3 feet in a yard. Create a class named InchConversion. Its main() method accepts a value in in
Dafna1 [17]

Answer:

import java.util.Scanner;

public class InchConversion

{

public static void main(String[] args) {

    Scanner input = new Scanner(System.in);

   

 System.out.print("Enter inches: ");

 double inches = input.nextDouble();

 

 inchesToFeet(inches);

 inchesToYards(inches);

}

public static void inchesToFeet(double inches){

    double feet = inches / 12;

    System.out.println(inches + " inches = " + feet + " feet");

}

public static void inchesToYards(double inches){

    double yards = inches / 36;

    System.out.println(inches + " inches = " + yards + " yards");

}

}

Explanation:

In the inchesToFeet() method that takes one parameter, inches:

Convert the inches to feet using the conversion rate, divide inches by 12

Print the feet

In the inchesToYards() method that takes one parameter, inches:

Convert the inches to yards using the conversion rate, divide inches by 36

Print the yards

In the main:

Ask the user to enter the inches

Call the inchesToFeet() and inchesToYards() methods passing the inches as parameter for each method

7 0
3 years ago
What happens when you print a document with red, green, and blue underline?
Olegator [25]
They will not show up on pages

8 0
3 years ago
Read 2 more answers
Other questions:
  • What do u call a individual that loves motor bikes and leather and is in a rival group known as mods?
    5·1 answer
  • What does a graphic organizer do
    6·1 answer
  • This type of method method performs a task and sends a value back to the code that called it:
    5·1 answer
  • The person who can give a short defination of subroutine will get the brainliest.
    9·1 answer
  • python Write a program that will take a file named Celsius.dat that contains a list of temperatures in Celsius (one per line), a
    9·1 answer
  • What is the missing line of code?
    7·1 answer
  • GMI = $4,666.67 Total Monthly Deductions $1,131.00 What is the Net Monthly Income (GMI - Total Monthly Deductions) =
    9·1 answer
  • Assert statements are a tool programmers employ to help them debug their code more efficiently.
    6·1 answer
  • CODEHS- Please help!
    8·1 answer
  • Rachelle is writing a program that needs to calculate the cube root of a number. She is not sure how to write the code for that
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!