Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource


Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.


Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.


<tr><td>1時間当たり入電数(件):</td><td><input id="call" type="text"/></td></tr>
<tr><td>平均通話時間(分):</td><td><input id="acd" type="text"/></td></tr>
<tr><td>平均後処理時間(分):</td><td><input id="acw" type="text"/></td></tr>
<input type="button" id="startBtn" value="稼働率を計算" /><br />
<div id="kadoritsuResult"></div>



                body {
  background: black;
  color: white;

table {
  width: 100%;
tr {
  background: #111;
  background: #333;
td {
  padding: 5px;



function start(){
 var call = $('#call').val();
 var acd = 60*$('#acd').val();
 var acw = 60*$('#acw').val();
 var aht = acd+acw;
 var kadoritsu = 0;
 var sheet = 0;
 var text = '<br /><table class="kadoritsuTable">';
 text += '<tr><td>応答率</td><td>稼働率</td><td>必要席数</td></tr>';

 for(var sl=0.5;sl<1;sl+=0.01){
  sheet = erlangc(call,aht,sl);
  kadoritsu = Math.round((getKadoritsu(call,aht,sheet))*100)/100;
  text += '<tr><td>' + parseInt(sl*100) + '%</td><td>' + kadoritsu +'</td><td>' +
  sheet + '席</td></tr>';

 text += '</table>';

function getKadoritsu(call,aht,sheet){
 return call/(3600/aht)/sheet

function erlangc(call,aht,sl){
    sl = 1 - sl;
    var erlang = aht*call/3600;
    var sheet = parseInt(erlang);
    var p = 1.0;
    var up = 1.0;
    var down = 0.0;
    var temp;

        for(var x=0; x<sheet; x++){
            up *= erlang/(sheet-x);
        up = up*sheet/(sheet-erlang);
        for(var x=0; x<sheet;x++){
            temp = 1.0;
                for(var y=0; y<x;y++){
                    temp *= erlang/(x-y);
            down += temp;
        down += up;
        p = up/down;
        up = 1.0; down = 0.0;
    return sheet;