Created
January 2, 2021 01:11
-
-
Save RealLogical/f2b9c5deac906d315de60af67797fef5 to your computer and use it in GitHub Desktop.
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
a=0 | |
b=0 | |
c=0 | |
d=0 | |
e=0 | |
f=0 | |
t=0 | |
for i0 in range(5): | |
a += 1 | |
for i1 in range(5): | |
b += 1 | |
for i2 in range(5): | |
c += 1 | |
for i3 in range(5): | |
d += 1 | |
for i4 in range(5): | |
e += 1 | |
print("a=" + str(a) + " b=" + str(b) + " c=" + str(c) + " d=" + str(d) + " e=" + str(e)) | |
if a==b or a==c or a==d or a==e or b==c or c==d or d==e: | |
f += 1 | |
else: | |
t += 1 | |
e = 0 | |
d = 0 | |
e = 0 | |
c = 0 | |
d = 0 | |
e = 0 | |
b = 0 | |
c = 0 | |
d = 0 | |
e = 0 | |
print("t=" + str(t) + " f=" + str(f)) | |
print("전체 경우의 수: " + str(t+f) + "\n조건과 일치하는 경우의 수: " + str(t)) | |
print("답: " + str(t)) | |
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
a=0 | |
b=0 | |
c=0 | |
d=0 | |
e=0 | |
f=0 | |
t=0 | |
for i0 in range(5): | |
a += 1 | |
for i1 in range(5): | |
b += 1 | |
for i2 in range(5): | |
c += 1 | |
for i3 in range(5): | |
d += 1 | |
for i4 in range(5): | |
e += 1 | |
print("a=" + str(a) + " b=" + str(b) + " c=" + str(c) + " d=" + str(d) + " e=" + str(e)) | |
if a==b or a==c or a==d or a==e or b==c or c==d or d==e: | |
f += 1 | |
else: | |
t += 1 | |
e = 0 | |
d = 0 | |
e = 0 | |
c = 0 | |
d = 0 | |
e = 0 | |
b = 0 | |
c = 0 | |
d = 0 | |
e = 0 | |
print("t=" + str(t) + " f=" + str(f)) | |
print("전체 경우의 수: " + str(t+f) + "\n조건과 일치하는 경우의 수: " + str(t)) | |
print("답: " + str(t)) | |
I Just Wanted To Play Minecraft
레전드
C 보단 좀 느리지만
파이썬이 역시 세계관 최강인 것 같습니다. (주관적인 의견입니다)
깃허브 계정 팔로우 박고 갑니다. ^^
코딩 더 올려주세요!
WOW..... Isn't it just a code that looks for the number of cases left without being adjacent? I think just 5x4x3x3x3....
와! 최고의 프로젝트에요!
와 정말 최고! 이것은 정말 최고의 프로젝트입니다
ㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋ
ㄹㅇ ㅋㅋ
와샌즈네
나도 저런거 만들어 보고 싶당
오오 파이썬을 여따가 쓰시다니.. 우왕 똑똑하시다,,
ㄷㄷ
속도가 느리니 C++로 다시 짜 봅시다
속도가 느리니 C++로 다시 짜 봅시다
#include <iostream>
using namespace std;
int main(){
int a = 0;
int b = 0;
int c = 0;
int d = 0;
int e = 0;
int f = 0;
int t = 0;
for (int i0=0; i0<5; i0++){
a += 1;
for (int i1=0; i1<5; i1++){
b += 1;
for (int i2=0; i2<5; i2++){
c += 1;
for (int i3=0; i3<5; i3++){
d += 1;
for (int i4=0; i4<5; i4++){
e += 1;
cout << "a=" << a << " b=" << b << " c=" << c << " d=" << d << " e=" << e << endl;
if (a==b or a==c or a==d or a==e or b==c or c==d or d==e){
f += 1;
}
else {
t += 1;
}
};
e = 0;
};
d = 0;
e = 0;
};
c = 0;
d = 0;
e = 0;
};
b = 0;
c = 0;
d = 0;
e = 0;
};
cout << "t=" << t << " f=" << f << endl;
cout << "전체 경우의 수: " << t+f << "\n조건과 일치하는 경우의 수: " << t << endl;
cout << "답: " << t << endl;
return 0;
};
짜왔습니다.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
LGTM ❤️