Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
fama.cs
Package: Visual.rar [view]
Upload User: yiyuerguo
Upload Date: 2014-09-27
Package Size: 3781k
Code Size: 1k
Category:
CSharp
Development Platform:
Others
- using System;
- public class myApp
- {
- static void Main()
- {
- int a,b,c,d;
- for(a = 1;a < 40;a++)
- for(b = 1;b < 40;b++)
- for(c = 1;c < 40;c++)
- for(d = 1;d < 40;d++)
- {
- if(a + b + c + d == 40)
- {
- if(Check(a,b,c,d))
- {
- Console.WriteLine("{0}t{1}t{2}t{3}",a,b,c,d);
- }
- }
- }
- Console.WriteLine("DONE");
- Console.ReadLine();
- }
- static bool Check(int a,int b,int c,int d)
- {
- int i,j,k,l;
- i = j = k = l = 0;
- for(int r = 1;r <= 40;r++)
- {
- for(i = -1;i <= 1;i++)
- for(j = -1;j <= 1;j++)
- for(k = -1;k <= 1;k++)
- for(l = -1;l <= 1;l++)
- {
- //如果可以称r重量 则直接跳出去称r+1的重量
- if(a*i + b*j + c*k + d*l == r)
- goto NextLoop;
- }
- //如果不能称r重量,则说明失败 返回假
- return false;
- NextLoop:
- continue;
- }
- return true;
- }
- }