C Problems and Solutions [closed]
开发者_开发知识库
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this questionI'm looking for a series of C problems (with solutions) that I can use to build my C skills. I already understand the basics of the language, the syntax, and the semantics. I am looking for a series of problems that will help me hone my skills, not a set of simple questions that you'd see in an introductory programming class.
You might try solving some of the problems on Project Euler. The first few are pretty simple, but they get very challenging very quickly. I think it's a lot of fun trying to come up with the shortest code or highly optimized code to compute the results (though, I generally use C++ or Python, not C).
One advantage the Project Euler problems have is that they aren't just language-centric; they're problems that really make you think hard about how to develop an elegant solution to difficult problems.
And don't forget code-golf.
You probably want to respond only to challenges (questions) that have at least 10 upvotes.
Here is a list of sites with online judges (and similar) which contains a large variety of problems:
(The sites are sorted in lexicographical order)
ACM Live Archive, problems from past ACM/ICPC regionals and World Finals.
Arbiter, online judge at Sharif University in Iran.
FZU Online Judge
Google Code Jam
Harbin Online Judge
Hangzhou Dianzi University (HDU) Online Judge
Hunan University ACM/ICPC Online Judge
IPSC (Internet Problem Solving Contest)
KSRU Online Judge
10.Jilin Online Judge
11.Lviv Online Judge
12.Moscow Online Judge
13.National Taiwan University Online Judge
14.Online Problems Solving System (OPSS)
15.Peking University Online Judge
16.Programming Challenges
17.Project Euler
18.Saratov Online Judge
19.Sphere Online Judge
20.TJU Online Judge
21.TopCoder
22.Ural Online Judge
23.USACO Training Program Gateway
24.UVa Online Judge
25.Wuhan University Online Judge
26.ZJU Online Judge
27.Z-Trening
Build libraries that implement sophisticated data structures, like binary trees, dictionaries, and such.
Write a compiler. It doesn't need to be complex or even complete: you can make up a simple language (a subset of lisp?) and then write a lexer for it. Make sure you start by laying down the formal grammar. You will touch memory management, pointer arithmetics and other neat C stuff.
I learnt a great deal about automata and compiler-design by writing a simple YAML parser in C++.
Try out Dennis Ritchie's book on C programming language. The book has quite good problems and also reading it is a joy :) For more challenging problems you can go to Bitwise Programming contest
Ruby Quiz has 156 problems with solutions. But in Ruby, not C. See the ruby-lang mailing list for more after James stopped being Ruby quiz master.
Knuth's repository of bitwise stuff might help in the noble pursuit :)
http://www-cs-faculty.stanford.edu/~knuth/fasc1a.ps.gz
Practice code Katas, language does not matter that much. Trying to solve Katas you allready did with another language is usually quite efficient to learn a new language.
You could always visit Freshmeat, find a few projects that interest you and look at their bug tracker. Grab the code and try to fix a few of the problems.
This helps open source while also helping you to get used to jumping in to someone else's code with debugging goggles on.
精彩评论