0% found this document useful (0 votes)
2 views1 page

Program 1

The Java program reads an integer 't' indicating the number of test cases. For each test case, it checks if the input string contains '2026' or does not contain '2025', printing '1' if either condition is true and '0' otherwise. The program uses a Scanner to read input from the user.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views1 page

Program 1

The Java program reads an integer 't' indicating the number of test cases. For each test case, it checks if the input string contains '2026' or does not contain '2025', printing '1' if either condition is true and '0' otherwise. The program uses a Scanner to read input from the user.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

import [Link].

*;

public class Main {


public static void main(String[] args) {
Scanner sc = new Scanner([Link]);
int t = [Link]();

while (t-- > 0) {


String s = [Link]();
if ([Link]("2026") || ![Link]("2025")) {
[Link](1);
} else {
[Link](0);
}
}
}
}

You might also like