「DRY」を含む日記 RSS

はてなキーワード: DRYとは

2019-03-05

極度乾燥(しなさい)について

旅行してる訪日中国人が「極度乾燥(しなさい)」というアウトドアジャケットを着ているのをよく見る。

彼らは日本におけるこのジャケットのダサさに気づいているのだろうか。

しか英語で上にSuper Dryと書いてある。日本スーパードライと言ったらビールしか思い浮かばない。

この二重のダサさ。

ちなみに作っているのはイギリス会社らしいのだが、ブランドから滲み出る中国人っぽさは何なんだろう。

2019-02-01

anond:20190201114926

いやいや、例えばPHPのpassword_hash()の結果を分割して保存しないでしょ。

文字数区切りで分割保存したとしたら、ハッシュアルゴリズム変わったとき区切り文字数の部分も変更しなきゃならなくて、典型的な非DRYじゃん。

2019-01-04

anond:20190104004246

DRY説明的なコードなんて中々書けないもんね…。

プログラムってホントに属人化しやすくて疲れる。

2018-06-25

anond:20180624172042

強制はよくないよね。仕事DRYを追求する上でアプリケーションとしては複雑すぎるコードが生まれそうなときOSSライブラリ作ってGitHub上げたりするけど、そうでもないとき基本的に他のことしてるな。ネトゲとか。

2018-04-28

anond:20180427204013

I love anal masturbation, intense pleasure and rest

I like anal masturbation, before standing glands reclamation.

I first purchased the prosthetic stimulation device and the milk tweezers electric props.

Gold is still off, I have no head anal masturbation.

Prepare and eat all the wild herbs a few days ago. Ginseng, big root oyster sauce, sirloin boiled. Large amounts of food, lactic acid bacteria captured. The stool is discharged well.

Anorectal beautiful.

The House of Secrets is secretly observing female sexual motion pictures. Instant limitation, I am female.

The female penis is inserted into the scene and my anal imagination is the female device.

Lubricant coated milk and anus.

The breasts caress about the use of electric appliances and anal peristalsis.

Before standing, the glandular stimulator was inserted and I reached the dry ceiling.

Extremely dry, I do not know the end.

Breast milk caressing stimulates the anal sensation of sensation, and the sensitivity of the former gland is upward.

Frontal glands and spermatozoa have the strongest pleasure organs.

I have not been too eager for heart (heart is too no penis to stimulate ejaculation).

I'm worried about the power of space and the stimuli.

I am unfamiliar and practice is necessary.

I am a male enthusiast, that is, anal masturbation enthusiast.

This article penis insertion desire, courage no.

The penis is ideal for all queens.

I haven't even had an anal masturbation, tired limit, and so on.

You are all well-connected!

Thank you.

2017-08-01

Don’t Repeat Your Selfとか言い出したやつ誰だよ

多くの人は更に曲解して悪魔的な方向に進化させてると思うんだけど

何で有名なんかね

 

wikiには

DRYアプリケーション必要情報(通例は設定情報)に対して言及しているという点で Once and Only Once (OAOO) 原則とは区別される。

とか書いてるけど、ほとんどOAOOの意味で皆解釈してない?

てか元からそういう書き方なんじゃないのか

俺読んでないけどさ

2016-11-26

noknead bread

一昨日から20時間以上かけて

つくった いわゆる捏ねないパン

自作としては完ぺきといってもよいのではなかろうか。

ゆめちからを使ったためか、もしくはBulk-fermentationを

20時間近く行うためか 要因は不明だが、

ふわふわ系のArtisanパンとなった。

ライ麦そば粉も混ぜ込んだ。両方合わせて 15%

Dry-ingredientの%表示は以下の通り:

wheat 83

guar gum 1

malt powder 1

rye and buck 15

2016-11-19

チーム開発が分からん

チームで開発って分からんね。

とあるWebサービス会社プログラマとしてに勤めて約1年。社会人3年目(といっても途中でブランク半年

個人的感想だが正直プロダクトのコードはひどい。

コピペコードもいっぱい。というか、現在進行形。「コピペしてちょっと直せばできるよね」なんてのをよく聞く。

手続き的でどうしてもロジックの重複もひどい。ifとswitchの嵐。

テストエクセル仕様書カバレッジ観点?何それみたいな空気

・動いてるところには触らない。

一方俺個人

DRY大好き。コピペなんてありえないでしょう(最近ちょっと緩まった)

オブジェクト指向大好き。if文?switch?多態で減らせない?

テスト?(何らかの意味で)網羅率意識は当然でしょJK

リファクタガンガンしてコード量を減らすべき。

とかまぁ独学が多いせいか原理原則みたいのに凝り固まってしまってると思う。

正直言って自分はチームとあってないと思う。コーディングスタイルだったり、開発速度だったり。それは申し訳ない。

プログラミングスタイルは嫌いだけど人としてとても好きな先輩は「合わせるのって大事だよね」っていう。

それは分かる。全体としての一貫性プログラムでとても重要なことだと思う。

その人は仕事も早いし、チーム最古参仕様歴史的経緯もよく把握してる。

でもさ、そんなプログラミング繰り返しても薄っぺらコードが積み重なるだけじゃん。

コード減らそうよ。コピペなんて恥ずかしくないのかと問いたい。

仕事遅くなってもちゃんと網羅率を意識したテスト仕様書書こうよ。

それができないのはコードのテスタビリティが低いからでしょ?

と思って、俺は毛色の違うコードを混ぜちゃう。それがプログラムとして正しいと思うし、ほかのスタイルで書けない。

迷惑なんだろうなと思うし未熟だと思う。

でも俺はプログラマとしてあんコード耐えられないし、やってはいけないと思う。

本来はチームに提案して、全体として方針を決めてそれに合わせるべきなんだろう。

俺が良いと思うからその方法で書く!なんてのは単なる我満だと思う。

彼はプログラマとしてダメだと思う。でもビジネスマンやチームでの開発者として正しいと思う。

なんだか納得できない。かと言って俺自身については今の仕事のやり方で良いと思わない。

からない

2016-05-20

プログラミングの楽しさ

railsプログラマーなんだけど、最初の頃は楽しく毎日書いてたけど、最近だんだん面倒になってきた。

プロジェクトが大きくて複雑になってきたというのもあるし、

DRYにしきれない部分が結構大きくて同じことを書き直すのがめんどい

かといって汎用化すると本来かかる以上の時間がかかってしまう。

あと、複数プロジェクトまたいで作業すると、

移動するたびに思い出したりrails sしたりで萎えてくる。

プログラミングなら朝から夜までずっとやってても平気って人がいるけど、

そういう人はなんでそんなんできるの?

2015-06-11

俺はプログラマ失格だ

同じことを何回も調べてる

DRYに反してる

2015-02-26

関数型言語使ってる時の気持ちよさは、ベーシックべた書きの頃と同じ

ひょっとすると、これはべたべたな一直線の手続き書き時代以来の「全てが一直線に並ぶ気持ちよさ」なのかもなぁ、と思った。

Haskellなんかを書いてると、究極的に、関数型言語におけるプログラムとは、一引数関数の深い深い一直線の入れ子みたいに感じられる。

(いやまぁ、タプルとかもあるけど、原則的に)

構造化⇒OOPと来て、プログラミング言語Go to hellを廃し、色んな物をDRYに書けるように進化してきたけど、その結果色々なものが並列にばらばらっと並んでいる感じになった。

OOP大本smalltalkメッセージパッシング原則の時点で、対等な二つの並列に並んだオブジェクトのやりとりがベースになっている。

勿論オブジェクトは大体内部に別のオブジェクトを抱えていたりして、親子関係があるのは普通だけれど、子同士はやはり並列に順序なく並んでいる。

この並列性のおかげで、例えばそれこそメッセージパッシングをそのまま引き継ぐErlangなんかは、高いスケーラビリティと耐久性を持つわけで、これ自体は素晴らしい発明だ。

ただ、やっぱり並列なヤツラが、ごちゃごちゃっと同時にあって、そいつらが同時にガチャガチャなんかやってたら、神の見えざる手的に、なんとなく全てが上手く噛み合って、プログラムが動きます、って、これどうしても全体像を把握しにくい。

人間脳みそって、そんな同時並列のものを把握できるようには、出来ていないんだと思う。

上手く動いてはいるんだけど、何で上手く行ってるのか分かるんだけど、分かりにくい。

この気持ち悪さが、今日もどこかのITおじさんを全部staticな書き方に走らせ、OOPわかんねー、と首をかしげながら、何となく使ってる人達の心を、巨大なメソッド作りに導いているのではないかな、と。

なんてったって、Scalaなら並列処理でさえ、モナドなFutureで事実上直線に繋いでいってかいちゃう(Akkaもあるけどあれはオブジェクティブな側面なので)わけで、これは凄く懐かし気持ちいいと思う。

かくして関数型言語は「なんかとにかくきもちいいぃぃぃぃ」な信者を量産している。そしてOOP派との間に、意味分からん溝だけが広がっていく。

2012-01-16

Digital video camera batteries matters need attention

Now, a digital camera is mainly rely on battery with power. Use the battery also has a lot of attention to the place, so that they can make a battery "prolong life".

Battery cleaning

In order to avoid the loss of the power problem, you want to keep the battery on both ends of the contact points and the battery cover internal clean. If the surface is very dirty words to use soft, clean dry cloth FuShi gently, can never use clean sex or the chemical has the solubility cleaner, such as diluent or contain alcohol solvent composition of the clean your digital camera, battery or charger.

Canon NB-8L Battery

For charging time, depends on the charger and battery, and whether the use of voltage stability, and other factors. Usually the first time to use the battery (or several months used battery) charging, li-ion batteries must more than six hours, the nimh batteries must be more than 14 hours, or future battery life will be short. And the battery and residual power, try not to repeat charging, to ensure the battery life.

Canon NB-6L Battery

Use process to avoid a discharge. A discharge is a power consumption over limit. Otherwise even recharge and its capacity cannot fully recover, for the battery is a kind of damage. Due to a discharge can lead to bad battery charging efficiency, reduce capacity, therefore camcorders are equipped with battery alarm function. So in similar circumstances should appear to replace the battery, try not to let the batteries run out and make the camcorders automatic shutdown.

The preservation of the battery

If you plan to use a long time without digital camera, must want the battery from a digital camera or remove the charger, and the discharge completely, and then stored in a dry, cool and environment, and try to avoid the battery and general metal items stored in together. In order to avoid short-circuited batteries, in batteries need not when, should cover to protect its preservation.

What kind of batteries belong to the green environmental protection battery?

The green environmental protection battery is to point to in recent years has been put into use or are development, the development of kind of high performance, no pollution batteries. At present already use large nickel metal hydride battery, the lithium ion battery and is expanded use of mercury free alkaline battery manganese zinc and rechargeable batteries and is research and development of lithium or lithium ion plastic pack and fuel cells belong to this category. In addition, it is widely used and use of solar energy for photoelectric convert solar cell (also called photovoltaic power generation), can also be included in this category.

Nickel metal hydride battery (Ni-MH) and nickel cadmium battery (Ni-Cd) have the same working voltage (1.2 V), due to the adoption of rare earth alloy or TiNi alloy anode materials for the activity of hydrogen storage material, replacing the carcinogen cadmium, which not only makes this battery became a kind of green environmental protection battery, and make a battery of energy than increased nearly 40%, to 80-60 Wh/kg and 210-240 Wh/L. The battery is 90 s gradually realize industrialization PANASONIC VW-VBK360 Battery , and the first to use in the cell phone battery. At present although it on their dominance of the gradually be lithium ion battery replaced, but mobile phone applications in Europe and America, and its market share is still at about 50%.

The lithium ion battery (Li-ion) is by can make the lithium ion embedding and take off the carbon embedded as negative, reversible intercalated-li metal oxide as the positive (LiCoO2, LiNiO2 or LiMn2O4) and organic electrolyte constitute, the working voltage of 3.6 V, so a lithium-ion battery is equivalent to three cadmium nickel metal hydride battery or nickel. Thus the batteries than energy is the over 100 Wh/kg and 280 Wh/L, and considerably more than the nickel metal hydride battery than energy. In view of the above advantages, since the 1993-2000 in just a few years, its production and usage with extremely high speed growth.

Alkaline manganese zinc dry (alkaline) compared with ordinary dry cell size has higher capacity PANASONIC CGA-S005E Battery, and have high discharge current ability. In recent years has been used on mercury zinc powder, therefore make the battery become a green battery, and become the mainstream battery products, at present the alkaline xinmeng dry cell is still BP machine use most power supply. At the same time, the world is the battery charged on the sex, an American company has launched a charged battery alkali manganese, product and application of slow growth. Such batteries keep the battery discharge characteristics, but also can be recharged using a dozen times to hundreds of times (deep recharge cycles life of about 25 times).

Lithium plastic battery (LIP) is for lithium metal anode, conductive polymers of electrolyte for new battery, the energy than has reached 170 Wh/kg and 350 Wh/L. The lithium ion battery is will present plastic of organic lithium ion battery electrolyte stored in a polymer membrane, or use conductive polymer as electrolyte, make a battery in no free the electrolyte. Such batteries can use aluminum plastic composite membrane realize hot pressing encapsulation, with light weight, shape can be arbitrary change, safety better characteristics.

Fuel cells (FC) is a kind of use of fuel (such as hydrogen or contain fuel) and antioxidant (such as pure oxygen or the oxygen in air) for power generation device directly, because avoided the carnot cycle limit, this power unit is not only high efficiency (electrochemical reactions conversion efficiency can be as high as 40% or more), and no pollution discharge gas, so is the future of efficient and clean power generation method. Many companies at home and abroad are engaged in development for mobile phones, notebook computers, the PEM fuel cell, once put into application, and its economy benefit greatly.

Seal lead-acid battery is a kind of lead-acid batteries.

The following new green battery technology and related industry development is rapid.

1. Hydrogen storage material and nickel metal hydride Battery-the nimh batteries (PANASONIC CGA-S101E/1B Battery)

2. Lithium ion embedded material and liquid electrolyte of lithium ion battery

3. Polymer electrolyte of lithium battery or lithium ion battery

4. Zinc air battery and PEM fuel cell

In addition to the above, in view of the communication industry growth, China's battery industry is with extremely high speed to promote environmental protection mercury-free alkali manganese zinc original pool and rechargeable batteries and seal lead-acid battery technology development and application expansion market.

2012-01-05

How to make digital camera battery more durable

Digital camera battery is the key for the key, second in importance only lens I’m afraid, and in order to photograph in your heart, a powerful battery to provide power as a follow-up is essential. But even the best battery time, if not properly carry out maintenance and maintenance, will not take long to lose the strong power, so battery maintenance is very important.

Battery Maintenance

For a (section) digital camera battery for the duration of use, not just its quality, power on, in fact, the use of operations with the user also has great relevance. Most photographers are used after every use of the camera on the camera bag inside, or on the cupboard, took out the battery is not kept separately, this approach sounds fine, but not conducive to battery protection.

If more than 15 days do not usually use the camera, it is best to remove the battery from the camera inside the store alone, save the environment, it is best to dry and cool place, and do not store the battery together with metal objects.

According to our survey, you can buy in the market most digital cameras use lithium batteries, it is relatively easy to store. The only caveat is that if not used for long, preferably at intervals of 2 months to activate a battery, which is the charge and discharge time, this can effectively extend battery life.

As for the Ni-MH battery 5, the most annoying is the memory effect, this effect will reduce the overall battery capacity and the use of time, and as time goes on, less and less stored charge, the battery will consume the more you have to faster. Therefore, we should try to run out of power rechargeable, each charge must be sufficient to power the most full.

If you go out, the temporary use of alkaline batteries, we must remember that time out, or when unused for long periods, the battery is easy to Tangshui corrosion circuit, the digital camera battery could not escape the destiny scrapped.

For users of alkaline batteries, already mentioned above, remember the point is finished using the digital camera, remove the battery must remember to avoid the phenomenon of cell sap and damage the machine.

As for the use of rechargeable nickel-metal hydride batteries and lithium users. Battery charge is very particular about, bought back the batteries are generally very low or no power consumption, the first charge must be adequate. Lithium battery charging time is generally longer than 8 hours, while the Ni-MH battery charging time is generally more than 16 hours. To achieve best results, that is, the battery has reached its maximum capacity, generally more than 3 times repeated charge-discharge can. Battery with three times, the best opportunity to find a completely exhausted battery to charge again, try not to charge the battery when there are remnants of repeated charge, or will shorten battery life. After the battery charge is generally more heat, it is best to be cool and then into the camera battery.

But note that lithium batteries because there is no memory effect, so do not discharge, otherwise it will damage the digital camera battery structure, loss of battery life.

In addition, in order to avoid the loss of electricity, the use of nickel-metal hydride battery user, charging is completed, remove the battery, do not let the battery contact with the conductor while the positive and negative poles, for example, do not use your fingers touch both ends of the battery. The use of lithium users should try to keep the camera inside the battery positive and negative battery contacts clean, if necessary, wipe with a dry cloth and then gently wipe the battery.

Also note that, even if the user is to use lithium batteries, digital camera in a long time when not in use, should be completely discharged, remove the battery, stored in a dry, cool environment. The other thing to note is that both the nickel-hydrogen batteries or lithium batteries using the user, it is best not to have a charged battery on the purse, pocket, bag or container with metal objects, in order to prevent short-circuit .

Digital camera battery power Dafa:

1, to avoid frequent use of flash: If you are not professional photographers, then, except in the invisible fingers of the night, the light intensity of an ordinary day for the average digital camera, it is enough.

2, try to avoid unnecessary zoom operation: zoom the camera lens stretched it out a reduction, is power digital camera battery. You can move the pace of hyperactivity, with “artificial zoom” approach instead of “camera zoom” to save power.

3, Do not let the screen has been lit: If the case of small power, can turn off the LCD screen, use the viewfinder to adjust the picture composition, is for a digital camera, LCD should be considered the most power-hungry components, general digital camera, LCD screen after closing time can be used when the original length of about 3 times.

4, less shooting and video: minimize the use of multi-shot feature and video capture video, as the completion of these functions is to use the built-in buffer body to temporarily save the screen shot, the power consumption a lot.

5, should not frequently open, shut down: Many users know that the display stays lit is power, so in order to save electricity use to frequent opening and shutdown. In fact, frequently open, shut down the electricity wasted consumption than bright display even more, especially for larger diameter lenses, but also requires a substantial expansion of the camera, the switch is power. Most digital cameras have automatic shutdown option, this setting should not be set too short, otherwise easily lead to frequent opening and shut down. Of course, frequent artificial opening, shut down and should be avoided.

6, optical image stabilization not normally open: Optical image stabilization is by driving the lens or image sensor pack components, offset by the subject matter images and the relative motion between the sensor achieved. Either way the optical image stabilization, would result in no small power consumption, in particular some models can be anti-shake mode is set to “always on” so that power loss will be caused by the more powerful. To this end, we have a good scene in the light should turn off the optical image stabilization feature, you must use, should also be less “always on” mode.

___________________________________________________

http://www.gobatteryonline.com/canon-powershot-sd600-battery-charger-gose.html

http://www.gobatteryonline.com/canon-powershot-sd630-battery-charger-gose.html

http://www.gobatteryonline.com/canon-nb-7l-digital-camera-battery-gose.html

2011-05-22

DRY

愛を教えてよ

愛を教えてよ

ねえ君は今も僕を愛しているの?

からない 分からないよ…

2010-06-22

http://anond.hatelabo.jp/20100620143255

http://anond.hatelabo.jp/20100621194920

Firstly let me congratulate your acquisition of a PhD. You have done something that most of us never can.

Considering how successful you are in academia, I believe some people were jealous and picked on your Japanese accents and unsociable sides. I can't blame them, however, to think how daring your feat seemed to them. Let alone receiving a PhD, a good number of us can't even hope to receive a bachelor's degree, not even in our dreams.

And doing so in a foreign country? In a foreign language? That's beyond our imagination.

You have climbed a peak that many others have failed.

If you are still unsure about your sense of humor and accents, maybe you should spend some time traveling and having fun: Normally dry sober days of studying does not improve your communication skills much.

Just have some fun with friends and you will pick up their accents eventually. The rest will be easy.

現実問題として語学の習得に掛かる時間は相当なものでしょうね。

大体人間が普段使う単語数は25k前後と聞きましたが、教養のある人はこれが40K以上になる筈です。一単語につき意味は一つではありませんから、一つの言語完璧な習得に必要な時間は、莫大なものとなります。

私の体感では、才能のない人が大人成ってから始めれば、フルタイムで8年から12年でしょうか(音楽なんかやってる人は早いみたいですよ。あと話し好きの方)?

英語は確かに必要なんですが、習得に必要とされるリソースの量に対して、リターンが微妙なのは事実です。私は勉強しなかった方ですが、それでも「今まで英語に使ったリソースを全て他の分野に投資出来ていたら、人生ここまで酷く成ってないかなぁ~」と思うことは多々有ります。

一部の人達の間に英語学習万能薬のように扱う傾向があるようですが、現実に十分な量のリソース学習に使えない(金銭的、時間的、環境的、或いは精神的理由から)私達の様な人間にとって「英語勉強しても(自分英語力が)リターンが発生する閾値に到達しないので、時間お金無駄」なんですよね・・・。

無論私の場合英語は半ば趣味ですから、勉強は続けますが。

子供は6歳前後から[b]ある一定以上の時間品質の良い英語教育[/b]を施せば、おそらくは違和感なくバイリンガルになるでしょうが、現実には費用人材の欠如が深刻で、日本でその様な教育を受けられる子供は殆どいません。またそのような教育制度の導入に必要な金額、現在教職についておられる方々の抵抗を考えるに、公立の学校でのサービス提供は不可能でしょう。

グローバル化適応するためには英語は確かに絶対必要なんですが、「明らかに習得が(諸々の事情から)出来ないであろう人達英語学習を勧めるのは国の長期戦略としては正しくでも、短期的には彼らをWORKING POOR ならぬ LEARNING TO BE POORしてしまう可能性は十分あるので、もっと英語学習を勧めるだけではなく、リスクの説明がなされるべきなのかもしれません。

2008-10-26

DRYFizzBuzz

http://anond.hatelabo.jp/20081026002746

ステートマシン大好きっ子としては書かずにいられない

もう少しがんばればforも無くせるな

fsmの中身ってDRYなの?的な話もあるだろうが,こんなもの他のプログラム自動生成すればいいんだよ!(開き直り)

#include <stdio.h>

static int process(unsigned char *str, int c) {
    if (str != NULL)
        puts(str);
    else
        printf("%d\n", c);
    return ++c % (3 * 5);
}

static int iter(int c) {
    return process(NULL, c);
}

static int fizz(int c) {
    return process("Fizz", c);
}

static int buzz(int c) {
    return process("Buzz", c);
}

static int fizzbuzz(int c) {
    return process("FizzBuzz", c);
}

static int (*fsm[])(int) = {
    fizzbuzz, iter, iter, fizz, iter,
    buzz, fizz, iter, iter, fizz,
    buzz, iter, fizz, iter, iter
};

int main(void) {
    int i, state;

    for (i = state = 1; i <= 100; i++) {
        state = (*fsm[state])(i);
    }

    return 0;
}

http://anond.hatelabo.jp/20081025233759

Thanks. 確かにそうなんだけど、putsだと勝手に改行が出力されてしまうので一ヶ所しか使えなかった。DRY、forなし、ifなし(:?使ってるのでインチキだけど)、main以外に関数なし風味。これで完成ということにして寝ます。

int main() {
  int fizz_buzz(int i, int limit) {
    int do_fizz_buzz(int num, int divisor, const char* str, int print) {
      return num % divisor == 0 ? do_fizz_buzz(num / divisor, divisor, str, 1) : (printf("%s", print ? str : ""), num);
    }
    do_fizz_buzz(do_fizz_buzz(i, 3, "Fizz", 0), 5, "Buzz", 0) == i ? printf("%d\n", i) : puts("");
    return i++ == limit ? 0 : fizz_buzz(i, limit);
  }
  return fizz_buzz(1, 100);
}

移植性の話は厳禁でw

2008-10-25

http://anond.hatelabo.jp/20081025230447

じゃぁ再帰で。

int fizz_buzz(int i, int j) {
  if(i % 3 == 0 &amp;&amp; j % 3 != 0) {
    printf("Fizz");
    return 1+ fizz_buzz(i / 3, j * 3);
  }
  if(i % 5 == 0 &amp;&amp; j % 5 != 0) {
    printf("Buzz");
    return 1 + fizz_buzz(i / 5, j * 5);
  }
  return 0;
}

int main(){
  int i;
  for(i=1; i<=100; i++){
    if(fizz_buzz(i, 1))
      printf("\n");
    else
      printf("%d\n", i);
  }
  return 0;
}

変数適当なのは勘弁。3とか5は適当に定数かマクロで置換すればDRY?

散々考え尽くされているんだろうけど、俺は挑戦するの初めてなので結構楽しいw

anond:20081025224505

全然DRYじゃないけど、

#include <stdio.h>
#define FIZZ 3
#define BUZZ 5

int main(void){
  int i;

  for(i=1; i<=100; i++){
    if((i % FIZZ == 0) || (i % BUZZ == 0)){
      if(i % FIZZ == 0)
        printf("Fizz");
      if(i % BUZZ == 0)
        printf("Buzz");
      printf("\n");
    }
    else
      printf("%d\n", i);
  }
  return 0;
}

で簡単な仕様変更には対処できるかと。

でも一度ですむものは一度ですませたいよねぇ。もうちょっと考えてみる。

アーカイブ ヘルプ
ログイン ユーザー登録
ようこそ ゲスト さん