This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package site.yourdiary.demo; | |
import java.util.Scanner; | |
public class QueueDemo { | |
public static void main(String[] args) { | |
int n, front, rear; | |
Scanner in = new Scanner(System.in); | |
n = in.nextInt(); | |
int[] queue = new int[50]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class BaiduByName { | |
public static void main(String[] args) { | |
try { | |
InetAddress address = InetAddress.getByName("www.baidu.com"); | |
System.out.println(address); | |
} catch (UnknownHostException e) { | |
e.printStackTrace(); | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
#include<string.h> | |
int main() { | |
char word[100]; | |
scanf("%s", word); | |
int len = strlen(word); | |
for (int i = 1; i <= len; i++) { | |
if (len % i == 0) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package site.yourdiary.demo; | |
import java.util.Scanner; | |
/** | |
* Created by star on 2017/7/7. | |
*/ | |
public class HuiWen { | |
public static void main(String[] args) { | |
Scanner in = new Scanner(System.in); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
#include<string.h> | |
int main() { | |
int i, ok, abc, de, x, y, z, count = 0; | |
char s[20], buf[99]; | |
scanf("%s", s); | |
for (abc = 111; abc <= 999; abc++) { | |
for (de = 11; de <= 99; de++) { | |
x = abc*(de % 10); y = abc*(de / 10); z = abc*de; | |
sprintf(buf, "%d%d%d%d%d", abc, de, x, y, z); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
#define N 0.000001 | |
int main() { | |
double n = 1.0; | |
int i; | |
int flag = 1; | |
double sum = 0.0; | |
for(i = 1; n >= N; i++){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
int main() { | |
int n; | |
int m; | |
scanf("%d", &n); | |
m = n; | |
for (int i = 0; i < n; i++) { | |
for (int k = 0; k < (2 * (n-m))/2; k++) { | |
printf(" "); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
int main() { | |
int n; | |
int m; | |
scanf("%d", &n); | |
m = n; | |
for (int i = 0; i < n; i++) { | |
for (int k = 0; k < (2 * (n-m))/2; k++) { | |
printf(" "); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
int main() { | |
int i = 10; | |
int a, b, c; | |
scanf("%d %d %d", &a, &b, &c); | |
while (i < 100) { | |
if ((i % 3 == a) && (i % 5 == b) && (i % 7 == c)) { | |
printf("%d\n", i); | |
return 0; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
#include<math.h> | |
int main() { | |
for (int i = 100; i <= 999; i++) { | |
int a = i % 10; | |
int b = i / 10 % 10; | |
int c = i / 100; | |
if (i == (pow(a, 3) + pow(b, 3) + pow(c, 3))) { | |
printf("%d\n", i); | |
} |
NewerOlder