Respuesta :
Answer:
//To pass in a string, and pass in a pivot string, and at that moment print in obligatory sequence, the string after pivot string till last as first string, and published beforehand the left slice of string.
import java.util.Scanner;
public class Main {
public static void main(String args[]) {
Scanner s2 = new Scanner(System.in);
System.out.println("Enter the parent String:");
String f2 = s2.nextLine();
System.out.println("Enter pivot(child string):");
String piv1 = s2.nextLine();
int start2 = f2.indexOf(piv1);
int end2 = piv1.length()+start2;
if (start2 == -1){
System.out.println("Error: child string(Pivot) not discovered.");
return;
}
String first2 = f2.substring(0,start2-1);
String second2 = f2.substring(end2);
if (f2.charAt(start2-1)==' '){
System.out.println(second2 + " " + piv1 + " " + first2);
return;
}
System.out.println(second2 + piv1 + first2);
}
}
Explanation:
Please check the answer section.
Answer:
This is the actual answer
n = int(input("How many numbers do you need to check? "))
odd = 0
even = 0
for i in range(1, n+1):
num = int(input("Enter number: "))
if (num % 2 == 0):
print(str(num)+ " is an even number.")
even = even + 1
else:
print(str(num)+ " is an odd number.")
odd = odd + 1
print("You entered " + str(even)+ " even number(s).")
print("You entered "+ str(odd)+ " odd number(s).")
Explanation:
Can I please have brainliest?